최근 우분투를 새로이 설치하면서 찾아본 오라클 JDK 설치 방법을 2가지로 정리 해본다.


1. PPA (Personal Package Archive) 이용


$ sudo apt-add-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer

2. Manual Install

  - Oracle Site에서 .tar.gz 파일을 다운로드.

     (http://www.oracle.com/technetwork/java/javase/downloads/index.html)

  - 압축 해제

$ tar zxvf jdk-8u45-linux-x64.tar.gz
$ sudo mkdir /usr/lib/jvm
$ sudo mv jdk1.8.0_45 /usr/lib/jvm

  - 명령어 등록

$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0_45/bin/java 1
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8.0_45/bin/javac 1
$
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.8.0_45/bin/javaws 1

- 설치된 Java버전이 여러개인 경우 차례대로 jdk1.8.0_45 버전 선택

$ sudo update-alternatives --config java

There are 2 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 auto mode 1 /usr/lib/jvm/jdk1.8.0_45/bin/java 1 manual mode 2 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 manual mode Press enter to keep the current choice[*], or type selection number: 1 update-alternatives: using /opt/jdk1.8.0_20/bin/java to provide /usr/bin/java (java) in manual mode

$ sudo update-alternatives --config javac
$
sudo update-alternatives --config javaws

- 설치 확인

$ java -version

 

+ Recent posts