DIGITory/Ubuntu2012. 5. 3. 21:36

1. JDK download

http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u4-downloads-1591156.html

바뀔 수도 있고... ㅎㅎㅎ tar파일을 받는다...

jdk-7u4-linux-x64.tar.gz 이런거... 난 64bit 10.10 ubuntu...


2. extract the file to the directory "/usr/lib/jvm/jdk1.7.0_04"

 no matter with the name of directory....


3.  just do this

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0_04/jre/bin/java" 1


4. and this....

sudo update-alternatives --config java


5. you can see the selection menu

There are 2 choices for the alternative java (providing /usr/bin/java).


  Selection    Path                                      Priority   Status

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

* 0            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      auto mode

  1            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      manual mode

  2            /usr/lib/jvm/jdk1.7.0_04/jre/bin/java      1         manual mode


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


6. enter 2!!!


7. set environment variables....

add this to .bashrc

export JAVA_HOME=/usr/lib/java/jdk1.7.0_04

export PATH=/usr/java/bin/:$JAVA_HOME:$PATH

export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib


That's it.


안되면 : http://www.wikihow.com/Install-Oracle-Java-on-Ubuntu-Linux

Posted by Joe.C