1. Download

   - wget을 통해 바로 다운로드 받을 수 없고, Web을 통해 라이선스 체크를 해야 다운로드가 된다.
   - http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html


2. Install

$ cd /srv/install/jdk

$ sudo -s tar zxvf jdk-7u45-linux-x64.tar.gz
$ sudo mkdir -p /usr/local/java
$ sudo -s mv ./jdk1.7.0_45 /usr/local/java/


3. PATH Configuration 1

$ sudo nano /etc/environment


PATH=...........:/usr/local/java/jdk1.7.0_45/bin
JAVA_HOME=/usr/local/java/jdk1.7.0_45

 

$ source /etc/environment



4. PATH Configuration 2

$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.7.0_45/bin/java" 1
$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.7.0_45/bin/javac" 1
$ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jdk1.7.0_45/bin/javaws" 1

$ sudo update-alternatives --set java /usr/local/java/jdk1.7.0_45/bin/java
$ sudo update-alternatives --set javac /usr/local/java/jdk1.7.0_45/bin/javac
$ sudo update-alternatives --set javaws /usr/local/java/jdk1.7.0_45/bin/javaws


     - 이렇게 하고 마지막으로 잘 되었는지 확인을 위해서 아래와 같이 버전을 확인해보자.

$ java -version


 

반응형

+ Recent posts