I'm trying to install JDK8 on Debian Stretch. The recommended way is to use JavaPackage.
I have successfully packaged JDK6 and JDK7 using this method:
- Download the JDK archive from Oracle
fakeroot make-jpkg jdk-7u55-linux-x64.tar.gz
dpkg -i the-resulting.deb
I can successfully create a .deb from the JDK8 archive, but when I install it with dpkg
I'm missing a lot of dependencies.
gnome-icon-theme gtk-update-icon-cache java-common libasound2 libasound2-data libatk1.0-0 libatk1.0-data libcroco3 libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libgail-common libgail18 libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libllvm3.9 libpciaccess0 librsvg2-2 librsvg2-common libtxc-dxtn-s2tc libx11-xcb1 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-sync1 libxcomposite1 libxcursor1 libxdamage1 libxfixes3 libxi6 libxinerama1 libxrandr2 libxshmfence1 libxtst6 libxxf86vm1 x11-common
I can install them manually but I'm not sure why I didn't have this dependency problem with the earlier JDKs. I'm writing an install script and it would please me to only install a single .deb rather than having to install all the extra dependencies separately.
make-jpkg
supports JDK8 according to its man page.
make-jpkg builds a Debian package from the given Java distribution FILE. Supported java binary distributions currently include: * Oracle (http://www.oracle.com/technetwork/java/javase/downloads) : - The Java Development Kit (JDK), version 6, 7 and 8 - The Java Runtime Environment (JRE), version 6, 7 and 8 - The Java API Javadoc, version 6, 7 and 8 (Choose tar.gz archives or self-extracting archives, do _not_ choose the RPM!)
Can anyone provide some insight as to why the .deb's created from earlier JDKs don't require any extra dependencies. Or perhaps it's just a case of their dependencies already existing in a stock Debian install.
Edit: I found this thread at Server Fault which goes some way to explaining it:
The reason this happens is that you are building a deb package from a binary distribution, i.e. a precompiled JDK. Usually, Debian packages are built from source, not from binaries. In order to do so, the person building the package would add all libraries the source depends on to a certain file (debian/control). Without those libraries installed, the source cannot be compiled and therefore would not result in a package.