See Centos 7 using JDK path YUM installation and configuration JAVA_HOME

1, the search path

  

[root@master01 jre]# which java
/bin/java
[root@master01 jre]# ls -l /bin/java
lrwxrwxrwx. 1 root root 22 Mar 22 01:01 /bin/java -> /etc/alternatives/java
[root@master01 jre]# ls -l /etc/alternatives/java
lrwxrwxrwx. 1 root root 73 Mar 22 01:01 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64/jre/bin/java

 2, placed JAVE_HOME

  

vi /etc/profile

  insert:

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64/jre
export PATH=$PATH:$JAVA_HOME/bin

  3, to validate the configuration

  

source /etc/profile

  

Guess you like

Origin www.cnblogs.com/irobotzz/p/12594305.html
Recommended