2013년 7월 24일 수요일

Installing Sun JDK 6 Update on Ubuntu 12.04


64bit Ubuntu에서는 apt-get install을 통한 sun-java6-jdk의 설치시 아래와 같은 에러가 발생한다.
The following packages have unmet dependencies:
 sun-java6-jdk:i386 : Depends: sun-java6-bin:i386 (>= 6.30-2~precise1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

apt-get install을 통해 설치가능한 oracle-java7-installer은 Android Platform Build 에서 Java Version error 가 발생한다.

Sun Java Download Centre. 에서 jdk 바이너리 다운로드 후 설치하는 방법에 대해 정리한다.

Installing Sun JDK 6 Update on Ubuntu 12.04

  1. Download the jdk-6u32-linux-i586.bin from the Sun Java Download Centre. If you are on 64-bit Ubuntu, you should grab jdk-6u32-linux-x64.bin.
  2. Make the bin file executable:
    1chmod +x jdk-6u32-linux-x64.bin
  3. Extract the bin file:
    1./jdk-6u32-linux-x64.bin
  4. Move extracted folder to this location:
    1sudo mv jdk1.6.0_32 /usr/lib/jvm/
  5. Install the new Java source in system:
    1sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_32/bin/javac 1
    2sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_32/bin/java 1
    3sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_32/bin/javaws 1
  6. Choose default Java:
    1sudo update-alternatives --config javac
    2sudo update-alternatives --config java
    3sudo update-alternatives --config javaws
  7. Check the Java version:
    1java -version
  8. Verify the symlinks all point to the new Java location:
    1ls -la /etc/alternatives/java*

댓글 없음:

댓글 쓰기