By murdock
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!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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:
root@debian-s-4vcpu-8gb-sfo2-01:~# dpkg --list | grep -i jdk
ii default-jdk 2:1.7-52 amd64 Standard Java or Java compatible Development Kit
ii openjdk-7-jdk:amd64 7u181-2.6.14-2~deb8u1 amd64 OpenJDK Development Kit (JDK)
ii openjdk-7-jre:amd64 7u181-2.6.14-2~deb8u1 amd64 OpenJDK Java runtime, using Hotspot JIT
ii openjdk-7-jre-headless:amd64 7u181-2.6.14-2~deb8u1 amd64 OpenJDK Java runtime, using Hotspot JIT (headless)
ii oracle-java8-installer 8u201-1~webupd8~1 all Oracle Java(TM) Development Kit (JDK) 8
ii oracle-java8-set-default 8u201-1~webupd8~1 all Set Oracle JDK 8 as default Java
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.