I followed this guide How To Install Java with Apt-Get on Debian 8 and it specifically said that this will install OpenJDK 8, the latest and recommended version.
But I get java 7 instead.
apt list --installed | grep jdk
openjdk-7-jre/oldstable,now 7u181-2.6.14-2~deb8u1 amd64 [installed,automatic]
openjdk-7-jre-headless/oldstable,now 7u181-2.6.14-2~deb8u1 amd64 [installed,automatic]
I can neither use apt-get --config java
because I only have one version installed.
I looked in /etc/apt/sources.list
and found that digitalocean have used their own mirrors by default, so I changed it to the default ones from debian and did apt update
, but still no java 8 package available.
I would appreciate some solution to get java 8, thanks!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $100 of credit to try our products over 60 days!
Hey friend,
You may want to go over the tutorial again. I just set up a Debian 8 droplet and followed the tutorial. Java 8 was installed as a result:
The tutorial is for Oracle JDK though at that stage (default version of OpenJDK or Oracle for 8/9), not OpenJDK. If it is necessary that OpenJDK be installed over the Oracle one, you may need to install it by hand or use a newer version of Debian that may have it bundled.
Jarland