On this post, I will guide you on installing Java on your development Linux machine. I decided to do this post after getting some questions on how ...
For further actions, you may consider blocking this person and/or reporting abuse
Hello thank for the article. How can I have multiple versions of JDK and Java ?
All the Linux distro have open-jdk in /etc/alternatives. Can I have jdk 11 and jdk 8 tohether?
Also I want to have the JDK 8 in /usr and a PATH variable java_home or java8 in system varibles, but I understand that the only way is to add variable in .bashrc.
Can you make it clear ?
Thank you in advance
I have added details on the article with JDK 17 and how to switch between versions using alternatives.
If you installed and configured an additional version in the guides, could have been super helpful because that's the whole point - "working with multiple versions of java", otherwise it's just another "How to install java in Linux - Tutorial"
Still forced to just work with /etc/environment | $PATH update
Hi, I followed your suggestion and added newest LTS 17 at the end of the post with instruction on how to switch between them. Hope it helps.
Cheers
How to configure open jdk 8 with this?
The process is the same, you just have to adjust the paths in your local computer.
This is amazing! Thank you Marcos for this post!
Just what I was looking for. Thanks for sharing!
I am glad it helped.
I have a problem. Using the 'echo $ PATH' command returns me a value but when reviewing the 'etc/environment' file you see another value. The same goes for the JAVA_HOME variable. Could you tell me what it is? Thanks for the support.
Hum.... most likely you have in one of these files under your $HOME folder: .bash_profile, .bashrc, .zshrc or similar a configuration setting the $JAVA_HOME specifically to an existing installation? If you have I would recommend you to remove the entry and source the file or restart / login again to see if it's gone. In most cases you don't really need a $JAVA_HOME hardcoded in your profiles(with some exceptions).
If you type only
env
in your terminal you should see all existent variables in your machine.It was good working!
Thanks a lot.
Great, helped me learn about alternatives in linux as well
I've just added more details. Check out here: github.com/logbasex/coding-notes/b...