Andrew Nguyen

How to Change Java Versions on Linux

Blog Post created by Andrew Nguyen Employee on Jun 29, 2016

Question:

I would like to change the Java versions on my RHEL machine. How would I go about doing this?

 

Answer:

 

Simply run these commands:

/usr/sbin/alternatives --config java

Follow the on-screen directions to ensure that the correct version of java is selected

 

/usr/sbin/alternatives --config javac

 

Follow the on-screen directions to ensure that the correct version of javac is selected

 

Run java -version to test which version of Java you are using.

Outcomes