java env

java env

1
2
3
4
5
6
7
8
[root@localhost app]# tar xzf jdk-8u111-linux-x64.tar.gz
[root@localhost app]# mv jdk1.8.0_111 /mnt/app/java
[root@localhost app]# echo 'JAVA_HOME=/mnt/app/java' | tee /etc/profile.d/java.sh
[root@localhost app]# echo 'JRE_HOME=${JAVA_HOME}/jre' | tee -a /etc/profile.d/java.sh
[root@localhost app]# echo 'CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib' | tee -a /etc/profile.d/java.sh
[root@localhost app]# echo 'export PATH=${JAVA_HOME}/bin:$PATH' | tee -a /etc/profile.d/java.sh
[root@localhost app]# source /etc/profile
[root@localhost app]# java -version