How Do I Find the Default Java Version in Linux?

How Do I Find the Default Java Version in Linux?
Contents

Finding out what Java version is installed on your Linux system is very easy, just type java -version .

Where is default Java path in Linux?

This depends a bit from your package system … if the java command works, you can type readlink -f $(which java) to find the location of the java command. On the OpenSUSE system I’m on now it returns /usr/lib64/jvm/java-1.6. 0-openjdk-1.6. 0/jre/bin/java (but this is not a system which uses apt-get ).

How do I choose 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:
Alexander Ross
Author

Alexander Ross

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.