How Do I Change Java Version in Ubuntu?

How Do I Change Java Version in Ubuntu?
Contents

How do I switch between Java versions in Ubuntu?

To switch between installed java versions, use the update-java-alternatives command. … where /path/to/java/version is one of those listed by the previous command (e.g. /usr/lib/jvm/java-7-openjdk-amd64 ).

How do I change Java version in Linux?

Procedure

  1. Download or save the appropriate JDK version for Linux. …
  2. Extract the compressed file to the required location.
  3. Set JAVA_HOME using the syntax export JAVA_HOME= path to JDK . …
  4. Set PATH using the syntax export PATH=${PATH}: path to the JDK bin . …
  5. Verify the settings using the following commands:
Marcus Vance
Author

Marcus Vance

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.