• Document Up to Date

Verifying Java Installs

This section lists how to verify Java installs.

Install Java

Download and install Java JDK 11 (either Oracle or OpenJDK).

Verify Java Version

Ensure that you are running Java 11. To check, run the following command at the command prompt and make sure that the version displayed is Java 11:

java -version

The command above should output something like this:

openjdk version "11.0.11

Verify JAVA_HOME environment variable is set correctly

Make sure that you have a JAVA_HOME environment variable that points to the root of the JDK install directory. To check the value set for JAVA_HOME, enter the following command at the command prompt:

env | grep JAVA_HOME

How to set the JAVA_HOME environment variable

To set JAVA_HOME

  • Korn and bash shells:

    export JAVA_HOME=jdk-install-dir
    export PATH=$JAVA_HOME/bin:$PATH
    

  • Bourne shell:

    JAVA_HOME=jdk-install-dir
    export JAVA_HOME
    PATH=$JAVA_HOME/bin:$PATH
    export PATH
    

  • C shell:

    setenv JAVA_HOME jdk-install-dir
    export JAVA_HOME
    PATH=$JAVA_HOME/bin:$PATH
    export PATH
    setenv PATH $JAVA_HOME/bin:$PATH
    export PATH=$JAVA_HOME/bin:$PATH