0

I'm trying to install java 10 on the 64 bit OS. I can install java 11 fine with sudo apt-get install openjdk-11-jdk-headless, but when I do sudo apt-get install openjdk-10-jdk-headless, I get the error

Package openjdk-10-jdk-headless is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

I found a similar issue on the github page Java OpenJDK 8 LTS not available for download. It was closed with the message

For anyone else having issues like this, I ended up downloading the Oracle JDK tarball off the developer portal. It contains a precompiled JRE that I copied to the user folder.

I have been able to download the .tar.gz file for jdk 10 from the java archive and extract it, but running java -version results in an error saying

java: command not found

This was my process for installing java 10, but any version between (inclusive) 8-10 would work, if that makes this any easier. I'm not sure what to do next. Thanks for your help.

1

The openjdk-10-jdk-headless and openjdk-11-jdk-headless are available on raspbian Buster.

 ~ $ apt policy openjdk-11-jdk-headless openjdk-10-jdk-headless

openjdk-11-jdk-headless:
  Installed: (none)
  Candidate: 11.0.9.1+1-1~deb10u2
  Version table:
     11.0.9.1+1-1~deb10u2 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
openjdk-10-jdk-headless:
  Installed: (none)
  Candidate: 10.0.2+13-2
  Version table:
     10.0.2+13-2 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages

You need to edit your /etc/apt/sources.list.d/raspi.list as follows:

deb http://archive.raspberrypi.org/debian/ buster main

Then:

sudo apt update
sudo apt install openjdk-10-jdk-headless
0

I found a guide here: Guide. I had to download the jdk from this site Oracle Java 8 Downloads and select the correct architecture, but following the guide after editing the java version worked perfectly.

1
  • Welcome, both available on raspbian Buster. – GAD3R Jan 28 at 22:58

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.