본문 바로가기

Linux/Ubuntu

11.04에서 sun-jdk install

[출처] : http://www.upubuntu.com/2011/06/how-to-install-sun-java-6-jrejdk-on.html

이놈들이 장난하나?
아무래도 오라클이 썬을 인한후 이지롤을 하는것 같다.

아래 방법대로 하면 설치된다.

만약 안된다면 아래 싸이트에서 직접 다운받아서 설치한다.
http://www.oracle.com/technetwork/java/archive-139210.html 



How To Install Sun Java 6 (JRE/JDK) On Ubuntu 11.04


In this tutorial, we will see how to install Sun Java 6 on Ubuntu 11.04. Due to the unavailability of Java packages in the official repository, we will resort to an external PPA.

Launch the Terminal and add this PPA using the following commands:

sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update

To insttall JRE (Java Runtime Environment), issue this command:

sudo apt-get install sun-java6-jre sun-java6-plugin

Then install JDK (Java Development Kit) with this command:

sudo apt-get install sun-java6-jdk



또는 

Java Sun JDK 1.5 or 1.6 no Ubuntu 10.10 or 11.04 (updated: 01 Jun 2011)

As we know, Java 1.5 has not been maintained anymore and Java 6, has been hanging around for a while and Java 7 is coming soon. But it doesn't mean everybody has to move on to Java 1.6. The problem in Ubuntu is they force you to use OpenJDK. Worse yet, they don't let you downgrade to 1.5.

There are lots of legacy systems running on Java 5 and we can't forget that. It is also about freedom of choice. If you want to install Sun JDK 5 or 6 Ubuntu should not make your life difficult.

Ubuntu 10 and 11 don't allow us to natively (or easily) install Sun JDK's via apt-get. 

It is so frustrate when we try to install it on Ubuntu 10.10 and have no luck:

sudo apt-get install sun-java5-jdk (or sudo apt-get install sun-java6-jdk)

After installed, the JDK will go to this directory: /usr/lib/jvm/java-6-sun

You can see all JDK's installed running the following command:

sudo update-java-alternatives -l


After a while, finally got the solution for this:

sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse"

sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse"

sudo apt-get update 

sudo apt-get install sun-java5-jdk



Check it out just to confirm:

sudo update-java-alternatives -l


The commands above worked for me in Ubuntu 10 and 11, installing Sun JDK 1.5 and 1.6.
If it doesn't work, try to add the following repositories and repeat the process: (anonymous suggestion - thanks a lot):

jdk-1.5 this.....
sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse"
sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates multiverse"


Cheers!

그리고 아래 방법으로 설치된 버젼을 확인하고 재설정도 가능함.
//  설치된 자바 목록을 확인 
 
$ sudo update-java-alternatives -l
java-1.5.0-sun 53 /usr/lib/jvm/java-1.5.0-sun
java-6-sun 63 /usr/lib/jvm/java-6-sun

// 사용하려는 자바 버젼으로 변경한다. 
 
$ sudo update-java-alternatives -s java-6-sun

// 자바 버젼을 확인한다. 

$ java -version 
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Server VM (build 16.3-b01, mixed mode)

'Linux > Ubuntu' 카테고리의 다른 글

12.04에서 JDK6 설치하기  (0) 2014.03.12
ubuntu 12.04 jdk 설치  (0) 2012.10.10
FTP 서버 설정하는 방법  (0) 2009.04.23
리눅스용 파일 비교 GUI  (0) 2009.04.07
vim explorer plug-in  (0) 2009.04.03