Centos 7構成JAVA_HOME
2418 ワード
JDK
取付経路which java
[root@iZ8vb2e3mzflkvty6k7eraZ agent-2.4.0-release]# which java
/usr/bin/java
ls -lrt /usr/bin/java
[root@iZ8vb2e3mzflkvty6k7eraZ agent-2.4.0-release]# ls -lrt /usr/bin/java
lrwxrwxrwx 1 root root 22 Apr 8 15:43 /usr/bin/java -> /etc/alternatives/java
ls -lrt /etc/alternatives/java
[root@iZ8vb2e3mzflkvty6k7eraZ agent-2.4.0-release]# ls -lrt /etc/alternatives/java
lrwxrwxrwx 1 root root 73 Apr 8 15:43 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.el7_6.x86_64/jre/bin/java
vim /etc/profile
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.el7_6.x86_64
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
source /etc/profile
echo $JAVA_HOME