安裝openJDK
1.8yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel
獲取java homejavascript
dirname $(readlink $(readlink $(which java)))
vim /etc/profile.d/env_export.shcss
在新建的文件中填寫java
export JAVA_HOME=上面dirname命令獲取到的路徑,不要bre/bin最後這段 export PATH=$PATH:$JAVA_HOME/bin export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
source /etc/profile.d/env_export.shvim