리눅스 계열 JDK설치
오라클 홈페이지에 가서 Linux용 tar.gz파일을 다운로드 한다. ▶▶오라클◀◀
jdk-8u91-linux-x64.tar.gz |
jdk-7u79-linux-x64.tar.gz |
# tar zxf jdk-7u79-linux-x64.tar.gz
압축 해제된 폴더를 관리하기 적당한 장소에 옮겨놓는다.
# mv jdk1.7.0_79/ /mylib/java
(X) # alternatives --install /usr/bin/java java /mylib/java/jdk1.7.0_79 2
(O) # alternatives --install /usr/bin/java java /mylib/java/jdk1.7.0_79/bin/java 1
(O) # alternatives --install /usr/bin/java java /mylib/java/jdk1.8.0_101/bin/java 2
***** 확인 ******
# alternatives --config java
# alternatives --remove java /mylib/java/jdk1.7.0_79
# alternatives --remove javac /mylib/java/jdk1.7.0_79/bin/javac
# alternatives --install /usr/bin/jar jar /mylib/java/jdk1.7.0_79/bin/jar 2
# alternatives --install /usr/bin/javac javac /mylib/java/jdk1.7.0_79/bin/javac 2
# alternatives --set jar /mylib/java/jdk1.7.0_79/bin/jar
# alternatives --set javac /mylib/java/jdk1.7.0_79/bin/javac
기동용 셸 또는 사용자의 셸에 아래와 같이 적용
1) JAVA_HOME
export JAVA_HOME=/mylib/java/jdk1.7.0_79
2) JRE_HOME
export JRE_HOME=/mylib/java/jdk1.7.0_79/jre
3) PATH
export PATH=$PATH:/mylib/java/jdk1.7.0_79/bin:/mylib/java/jdk1.7.0_79/jre/bin