How to Update a Java Version in PATH

Sun's Java Programming Language allows a developer to write an application once and deploy it on any system running the appropriate version of the Java software. Differences in versions can mean loss of older features, changes in how systems operate and other discrepencies that cause applications to fail. In Linux, the $JAVA_HOME server variable is used to reference the path to Java. If you have multiple versions of Java installed, you can update this path to point to an older or newer version at will.

Instructions

    • 1

      Locate your installations of Java. Type "whereis Java" without quotes on the Linux command-line. If the directories are not labeled with versions, you can navigate to the /bin/ folder within it and type ./java -v to see a version printout.

    • 2

      Alter your JAVA_HOME variable to point to the new directory path. Type: "JAVA_HOME=/path/to/java/version; export JAVA_HOME; PATH=$JAVA_HOME/bin:$PATH; export PATH" without quotes.

    • 3

      Verify JAVA_HOME now shows the correct path. Type "echo $JAVA_HOME" and view the displayed directory.

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured