How to check JAVA_HOME environment variable under Cent OS 7
11,272
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
- An A-Z Index of the Bash command line for Linux - An excellent reference for all things Bash command line related.
Related videos on Youtube
Comments
-
DmitryBoyko almost 2 years
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)
-
DavidPostill over 8 years
env | grep JAVA_HOME
-