DIGITory/Ubuntu2012. 4. 5. 14:32



※ you can also install 'openjdk-6-jdk' by "sudo apt-get install openjdk-6-jdk"...


This is about installing SUN-JAVA JDK.


1.  Downloading

go to "http://www.oracle.com/technetwork/java/javase/downloads/index.html"

and donwload jdk (I got "jdk-7u3-linux-i586.tar.gz")

and extract it. you can see a directory named ""jdk1.7.0_03"

move the directory to "/usr/lib/java/" (create the 'java' directory)


2.  Installing

execute 'sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/java/jdk1.7.0_03/jre/bin/java" 1'

and 'sudo update-alternatives --config java'

If you have another java-jdk, you can see some menus to select.

If you have just one, you can see this...

"There is only one alternative in link group java: /usr/lib/java/jdk1.7.0_03/jre/bin/java

Nothing to configure."


3. Checking

add the directory to PATH.

I did... edit '~/.bashrc' file. 

adding.... 

'export JAVA_HOME=/usr/lib/java/jdk1.7.0_03'

'export PATH=$JAVA_HOME:$PATH'

and excute 'java -version' to check.

you can see this...finally.

-------------------------------------------------------------------------------------

java version "1.7.0_03"

Java(TM) SE Runtime Environment (build 1.7.0_03-b04)

Java HotSpot(TM) Server VM (build 22.1-b02, mixed mode)


Posted by Joe.C