How to Check Java_Home Environment Variable Under Cent Os 7

How to Check Java_Home Environment Variable Under Cent Os 7

The manual of Collabnet says that we have to setup JAVA_HOME environment variable. How to check if this variable has been configured already?

1. Set the JAVA_HOME environment variable, and point it to your Java 6 JRE
      home.  For example:

      export JAVA_HOME=/usr/java/default

      Test the variable:

      $ $JAVA_HOME/bin/java -version
      java version "1.6.0_20"
      Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
      Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)
1

1 Answer

How do I to check if JAVA_HOME has been configured already?

There are many ways to do this.

In a bash shell you can use any of the following commands:

echo $JAVA_HOME

printf $JAVA_HOME

env | grep JAVA_HOME

printenv | grep JAVA_HOME

Further Reading

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Robert Thorne
Author

Robert Thorne

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.