Tuesday, June 7, 2016

View and Change Current JAVA version in Linux

Even though you have changed the JAVA_HOME variable in linux to chanhge the current java version in linux, java -version command will out put a version which you are not expecting. This may cause system has been installed several java versions.

As a solution for that you can change both JAVA_HOME and update-alternatives.

1) Change the JAVA_HOME variable as usual. (echo $JAVA_HOME to ensure)
2) Then type sudo update-alternatives --config java and follow the provided instructions.
3) Now java -version command should output the expected correct version of the java.

No comments:

Post a Comment