0

I need Oracle JDK and JRE so i downloaded tar.gz from Oracle downloads page Extracted using tar zxvf jdk-9.0.4_linux-x64_bin.tar.gz as described here https://docs.oracle.com/javase/9/install/installation-jdk-and-jre-linux-platforms.htm#JSJIG-GUID-ADC9C14A-5F51-4C32-802C-9639A947317F

But when i type java -version i am getting this error:

image here

  1. Why its not working, what are the actual steps to install Oracle jdk9 properly as above steps are not working

  2. I also want jdk and jre(Oracle only) both installed via tar and accessed with java -version and JAVA_HOME set.

  3. As you can see I cd into jdk -> bin and typed java -version but its not working, I wonder why is that? this is where actual binaries lives.

image here

0

Java is one of the many commands which can be installed to / configured (selected) in /etc/alternatives/

Java 9 example

$ sudo update-alternatives --install /usr/bin/java java /usr/java/jdk-9.0.4/bin/java 1
$ sudo update-alternatives --install /usr/bin/javac javac /usr/java/jdk-9.0.4/bin/javac 2

If more than one version, please select with :

$ sudo update-alternatives --config java

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.