lost and found ( for me ? )

Linux Mint 14 64bit : change java version from open java to Oracle Java



mint ~ # tail -1 /etc/lsb-release
DISTRIB_DESCRIPTION="Linux Mint 14 Nadia"
mint ~ # uname -ri
3.5.0-26-generic x86_64


install JDK from Oracle’s site.
I downloaded  jdk-7u17 for Linux 64bit.
mint hattori # ls *.tar.gz
jdk-7u17-linux-x64.tar.gz

make a directory for JDK 1.7.0
mint jvm # mkdir /usr/lib/jvm/jdk1.7.0-oracle

extract jdk and move files under /usr/lib/jvm/jdk1.7.0-oracle directory.
mint hattori # tar xzvf jdk-7u17-linux-x64.tar.gz
mint hattori # mv ./jdk1.7.0_17 /usr/lib/jvm/jdk1.7.0-oracle

change java version. select oracle java
mint hattori # update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0-oracle/jdk1.7.0_17/bin/java" 1

mint hattori # update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0-oracle/jdk1.7.0_17/bin/javac" 1

mint hattori # update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0-oracle/jdk1.7.0_17/bin/javaws" 1


mint hattori # update-alternatives --config java
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/jdk1.7.0-oracle/jdk1.7.0_17/bin/java   1         manual mode

Press enter to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/lib/jvm/jdk1.7.0-oracle/jdk1.7.0_17/bin/java to provide /usr/bin/java (java) in manual mode
mint hattori #

mint ~ # update-alternatives --config javaws
There are 3 choices for the alternative javaws (providing /usr/bin/javaws).

 Selection    Path                                                 Priority   Status
------------------------------------------------------------
 0            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/javaws      1071      auto mode
 1            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/javaws      1061      manual mode
 2            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/javaws      1071      manual mode
* 3            /usr/lib/jvm/jdk1.7.0-oracle/jdk1.7.0_17/bin/javaws   1         manual mode

Press enter to keep the current choice[*], or type selection number: ^C
mint ~ # 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/jdk1.7.0-oracle/jdk1.7.0_17/bin/javac   1         manual mode

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

mint ~ # update-alternatives --config javaws
There are 3 choices for the alternative javaws (providing /usr/bin/javaws).

 Selection    Path                                                 Priority   Status
------------------------------------------------------------
 0            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/javaws      1071      auto mode
 1            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/javaws      1061      manual mode
 2            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/javaws      1071      manual mode
* 3            /usr/lib/jvm/jdk1.7.0-oracle/jdk1.7.0_17/bin/javaws   1         manual mode
l
Press enter to keep the current choice[*], or type selection number: 3
mint ~ #

confirm java version
mint hattori # java -version
java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.