java-8-openjdk-amd64 is already installed by default on my Debian testing system (Buster), and I would like to keep it installed.

openjdk-7-jdk is not in my testing package list.

According to its package page, it’s available on Jessie. So I added this repository :

deb http://security.debian.org/debian-security jessie/updates main

but OpenJDK 7 won’t install:

openjdk-7-jdk depends openjdk-7-jre but it is not going to be installed
openjdk-7-jre : depends: openjdk-7-jre-headless (= 7u151-2.6.11-2~deb8u1) but it is not going to be installed
openjdk-7-jre : Depends: libgif4 (>= 4.1.4) but it is not installable 

I know I can use update-alternatives to switch between several JDK versions, but how do I get OpenJDK 7 installed in the first place?


The security repository, which is what you’ve added, isn’t a standalone repository; to use it, you also need to add the corresponding “main” repository:

deb http://deb.debian.org/debian jessie main

This would have allowed you to install OpenJDK 7 in the past; unfortunately, the Jessie package can no longer be installed in a Buster system because it ends up depending on tzdata-java, which needs a specific version of tzdata which can’t be satisfied without downgrading the Buster version.

There is another way to install OpenJDK 7 on a Buster system: you can install it from experimental. Add

deb http://deb.debian.org/debian experimental main

to your repositories (and remove the Jessie entries while you’re at it), and run

apt install -t experimental openjdk-7-jdk
| improve this answer | |
  • I still get openjdk-7-jre : Depends: openjdk-7-jre-headless (= 7u151-2.6.11-2~deb8u1) but it is not going to be installed. following through the chain of unsatisfied dependancies : tzdata-java : depends: tzdata (= 2017c-0+deb8u1) but 2018c-1 is to be installed – Albizia Mar 22 '18 at 11:30
  • 1
    Ah yes, that means the Jessie package can’t be used in Buster. There is another solution; see my update. – Stephen Kitt Mar 22 '18 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.