I lost track of the installation directory on the server for various reasons.
JAVA_HOME
This is OK if you are using the version you are currently using (the version that works with the java command).
$ printenv JAVA_HOME
/usr/java/default
PATH
If the version you are currently using (the version that works with the java command) does not have JAVA_HOME
, this is OK.
$ printenv PATH | sed -e 's/:/:\n/g' | grep java
/usr/java/default/bin:
yum
It's common to have multiple versions installed.
When you want to find a version of Java that is not set to JAVA_HOME
.
#Check installed packages from version
$ yum list installed | grep java-1.7
java-1.7.0-openjdk.x86_64 1:1.7.0.151-2.6.11.0.el6_9
java-1.7.0-openjdk-devel.x86_64
#Check the installation directory
$ rpm -ql java-1.7.0-openjdk-devel.x86_64 | grep bin
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.151.x86_64/bin
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.151.x86_64/bin/appletviewer
...abridgement...
Recommended Posts