Be aware that this tutorial was written for Debian Jessie. If you are using Debian Stretch (or Ubuntu Xenial Xeres / Bionic Beaver) you can just install OpenJDK version 8 right away or learn how to install OpenJDK 9
Since OpenJDK 8 is out there since march 2014 I wanted to install it on my freshly setup Debian Jessie. But trying to, I was surprised that the OpenJDK is only available in version 7. To successfully install version 8 you need to perform the following steps:
Prepare your system
The desired version of OpenJDK is not available in out-of-the-box Debian Jessie. So you have to rely on Debian Backports repository and add the following lines to the end of your /etc/apt/sources.list file:
# jessie backports deb http://http.debian.net/debian jessie-backports main
Install OpenJDK 8
The installation of version 8 is then straight forward:
sudo apt-get update sudo apt-get install -t jessie-backports openjdk-8-jdk
Make version 8 your default Java
This step is optional. Debian provides a neat Tool to change default Java on your system.
- To check which JDK-Versions are available on your system perform:
sudo update-java-alternatives --list
On my system (64-bit) the output is:
java-1.7.0-openjdk-amd64 1071 /usr/lib/jvm/java-1.7.0-openjdk-amd64 java-1.8.0-openjdk-amd64 1069 /usr/lib/jvm/java-1.8.0-openjdk-amd64
- To update your all relevant symlinks at once use:
sudo update-java-alternatives --set java-1.8.0-openjdk-amd64
(in a 32-bit environment use -i386 postfix instead of -amd64)
You can ignore the errors about to a missing java plugin as you probably just did not install the java browser plugin.
thanks Moe
Thank you very much for this post
Thank you very much for the post.
Thank you !
This is the command that I needed to solve my problem
sudo apt-get install -t jessie-backports openjdk-8-jdk
Thank you! This helped me.
Gracias! 😀 Buen dÃa! Excelente aportación! Saludos!
All that simple, exactly the output shown. Great! Thanks a lot Moe!
Thanks a lot Moe
Thank you very much….
Thanks man, you are the best <3
Thanks for this manual. Pretty useful to install ‘openjdk-8-jre’ (just the run-time, no development needed ;-).
Thank you so much, Moe. Your post has really helped me.
Thank you!
Thanks alot. This saved my day.