Debian – OpenJDK7 JRE 32-bit on Debian Stretch 64-bit

aptdebianmultiarchpackage-management

I am currently using Debian Stretch (testing, at the moment). I need to install Java 7 32-bit to be able to work with an old applet that is only compatible with that specific version: No 64-bit, no Java 8 (please don't judge me).

There's currently no openjdk-7-jre package available in testing, only openjdk-7-jre, which is not even available for i386 architecture and also not enough to run the applet.

I came across the idea to pin it from the stable release (Jessie), so I added the following files:

/etc/apt/sources.list.d/stable.list

deb http://ftp.caliu.cat/debian/ stable main contrib non-free
deb-src http://ftp.caliu.cat/debian/ stable main contrib non-free

deb http://security.debian.org/ stable/updates main contrib non-free
deb-src http://security.debian.org/ stable/updates main contrib non-free

# stable-updates, previously known as 'volatile'
deb http://ftp.caliu.cat/debian/ stable-updates main contrib non-free
deb-src http://ftp.caliu.cat/debian/ stable-updates main contrib non-free

/etc/apt/preferences.conf

Package: *
Pin: release a=stable
Pin-Priority: 100

Now, I can find package openjdk-7-jre:i386, however, when I try to install it via apt-get -t stable install openjdk-7-jre:i386 I'm getting this:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 openjdk-7-jre:i386 : Depends: openjdk-7-jre-headless:i386 (= 7u111-2.6.7-1~deb8u1) but it is not going to be installed
                      Depends: libatk1.0-0:i386 (>= 1.12.4) but it is not going to be installed
                      Depends: libcairo2:i386 (>= 1.2.4) but it is not going to be installed
                      Depends: libfontconfig1:i386 (>= 2.11) but it is not going to be installed
                      Depends: libfreetype6:i386 (>= 2.2.1) but it is not going to be installed
                      Depends: libgdk-pixbuf2.0-0:i386 (>= 2.22.0) but it is not going to be installed
                      Depends: libgtk2.0-0:i386 (>= 2.8.0) but it is not going to be installed
                      Depends: libpango-1.0-0:i386 (>= 1.14.0) but it is not going to be installed
                      Depends: libpangocairo-1.0-0:i386 (>= 1.14.0) but it is not going to be installed
                      Depends: libpangoft2-1.0-0:i386 (>= 1.14.0) but it is not going to be installed
                      Depends: libx11-6:i386 but it is not going to be installed
                      Depends: libxcomposite1:i386 (>= 1:0.3-1) but it is not going to be installed
                      Depends: libxext6:i386 but it is not going to be installed
                      Depends: libxi6:i386 but it is not going to be installed
                      Depends: libxrender1:i386 but it is not going to be installed
                      Depends: libxtst6:i386 but it is not going to be installed
                      Depends: libxrandr2:i386 but it is not going to be installed
                      Depends: libxinerama1:i386 but it is not going to be installed
                      Depends: libgl1-mesa-glx:i386 but it is not going to be installed or
                               libgl1:i386
                      Depends: libatk-wrapper-java-jni:i386 (>= 0.30.4-0ubuntu2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I'm not very experienced with Apt-pinning, so I tried other Pin-Priority values with the same luck.

Of course I could download the openJDK-7 JRE 32-bit version by myself and install it but I would really prefer to use the package manager, where possible, can anyone give me a hint of what I'm doing wrong?

Thank you!

Best Answer

There are a couple of changes between stable and testing (libgif4 and tzdata-java) which will make it very hard to use the stable versions of openjdk-7-jre.

Instead, since you're running testing, you should use the version currently available in experimental; add

deb http://ftp.caliu.cat/debian/ experimental main
deb-src http://ftp.caliu.cat/debian/ experimental main

to your repositories, apt-get update, and then you should be able to install openjdk-7-jre:i386.

Related Question