Question

Can't install java jdk 11 on debian 9

Hello everyone, in short I tried for a past week to instal java 11 jdk on my debian 9 dedicated server and… Well I can install java but any programs who use java shows that java not installed. I’m hosting game server and from last update it requires java 11. With java 8 everything working fine I tried tens of different variations how to install java jdk 11 but nothing works for me. No idea why… Maybe someone have some ideas why?


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @deimantasgaizauskas,

So, there can be a few reasons behind the experienced issues. Firstly, make sure you’ve covered the proper tutorial for installing Java on Debian. It’s full of unreliable sources. In this case DigitalOcean have a pretty good article on how to install Java https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-on-debian-9 .

Having said that in the tutorial it’s not mentioned how to exactly install Java11 only up to Java10 so after you follow the initial configuration steps, to install Java11 you should be able to perform the following

  • Get the proper repo
echo 'deb http://ftp.debian.org/debian stretch-backports main' | sudo tee /etc/apt/sources.list.d/stretch-backports.list
  • Make an update
sudo apt update
  • Install Java11
sudo apt install openjdk-11-jdk

Now, if you still are experiencing issues, here comes the second bug I can think of. Since you mentioned you have Java8 installed and everything works fine with it, are you sure that when you install Java11 you are not still using the Java8 binaries? Java11 and Java8 do have different paths and as such the binaries located for them are also in different folders.

Regards, KDSys