sun-java update JRE/JDK 6->7

Сваляме си пакетите от официалния сайт http://www.oracle.com/technetwork/java/javase/downloads/index.html

jdk-7u6-linux-i586.tar.gz

jre-7u6-linux-i586.tar.gz

java -version
java version “1.6.0_26”
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

tar zxvf jdk-7u6-linux-i586.tar.gz
mv jdk1.7.0_06/ /usr/lib/jvm/jdk1.7.0_06
update-alternatives –install “/usr/bin/java” “java” “/usr/lib/jvm/jdk1.7.0_06/bin/java” 1
update-alternatives –install “/usr/bin/javac” “javac” “/usr/lib/jvm/jdk1.7.0_06/bin/javac” 1
update-alternatives –install “/usr/bin/javaws” “javaws” “/usr/lib/jvm/jdk1.7.0_06/bin/javaws” 1
update-alternatives –config java
There are 3 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
————————————————————
* 0 /usr/lib/jvm/java-6-sun/jre/bin/java 63 auto mode
1 /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode
2 /usr/lib/jvm/jdk1.7.0_06/ 1 manual mode
3 /usr/lib/jvm/jdk1.7.0_06/bin/java 1 manual mode

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

java -version
java version “1.7.0_06”
Java(TM) SE Runtime Environment (build 1.7.0_06-b24)
Java HotSpot(TM) Client VM (build 23.2-b09, mixed mode)

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-6-sun/bin/javac 63 auto mode
1 /usr/lib/jvm/java-6-sun/bin/javac 63 manual mode
2 /usr/lib/jvm/jdk1.7.0_06/bin/javac 1 manual mode

Press enter to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/lib/jvm/jdk1.7.0_06/bin/javac to provide /usr/bin/javac (javac) in manual mode.
update-alternatives –config javaws
There are 2 choices for the alternative javaws (providing /usr/bin/javaws).

Selection Path Priority Status
————————————————————
* 0 /usr/lib/jvm/java-6-sun/jre/bin/javaws 63 auto mode
1 /usr/lib/jvm/java-6-sun/jre/bin/javaws 63 manual mode
2 /usr/lib/jvm/jdk1.7.0_06/bin/javaws 1 manual mode

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

Enable mozilla firefox plugin:

32 bit:
ln -s /usr/lib/jvm/jdk1.7.0/jre/lib/i386/libnpjp2.so ~/.mozilla/plugins/

64 bit:
ln -s /usr/lib/jvm/jdk1.7.0/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins/
Depending on your configuration, you might need to update the apparmor profile for firefox (or other browsers) in /etc/apparmor.d/abstractions/ubuntu-browsers.d/java

# Replace the two lines:
# /usr/lib/jvm/java-*-sun-1.*/jre/bin/java{,_vm} cx -> browser_java,
# /usr/lib/jvm/java-*-sun-1.*/jre/lib/*/libnp*.so cx -> browser_java,
# with those (or adapt to your new jdk folder name)
/usr/lib/jvm/jdk*/jre/bin/java{,_vm} cx -> browser_java,
/usr/lib/jvm/jdk*/jre/lib/*/libnp*.so cx -> browser_java,
Then restart apparmor:

sudo /etc/init.d/apparmor restart

стъпките за ъпдейт на jre са идентични.

http://askubuntu.com/questions/56104/how-can-i-install-sun-oracles-proprietary-java-6-7-jre-or-jdk

http://askubuntu.com/questions/55848/how-do-i-install-oracle-java-jdk-7

Leave a Reply

Your email address will not be published. Required fields are marked *