JDK 설치 및 변경 (Ubuntu 11.10, 14.10LTS)


우분투 버전 확인

cat /etc/lsb-release
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk

선택적으로 아래와 같이 변경 할 수 있다.

sudo update-alternatives --config java
sudo update-alternatives --config javac

원하는 JDK를 선택한다.

Openjdk-7-jdk Lolli-POP
Java 6: for Gingerbread through KitKat
Java 5: for Cupcake through Froyo
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/java-7-openjdk-amd64/jre/bin/java   1071      manual mode
  2            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1069      manual mode

Press enter to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java to provide /usr/bin/java (java) in manual mode
root@jemin-virtual-machine:~# update-alternatives --config javac
There are 2 choices for the alternative javac (providing /usr/bin/javac).

  Selection    Path                                         Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-7-openjdk-amd64/bin/javac   1071      auto mode
  1            /usr/lib/jvm/java-7-openjdk-amd64/bin/javac   1071      manual mode
  2            /usr/lib/jvm/java-8-openjdk-amd64/bin/javac   1069      manual mode

Press enter to keep the current choice[*], or type selection number: 2


+ Recent posts