Showing posts with label update java. Show all posts
Showing posts with label update java. Show all posts

Wednesday, September 9, 2015

update java 1.7.0_79 to 1.8.0_60

If new install ubuntu can install java with command
sudo apt-get install ubuntu-restricted-extras openjdk-8-jdk


1.Download java
2. extract java
cp /home/hades/Downloads/jdk-8u60-linux-x64.tar.gz /opt/
3. tar xvzf jdk-8u60-linux-x64.tar.gz
4. Install control java config
#apt-get install galternatives
#galternatives

add java, javac, javaws read more info


5. configure java default
#update-alternatives --config java


6. Check java version
root@mail:/opt# java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

7. configure plugins firefox
/.mozilla$ mkdir plugins
ln -s /opt/jdk1.8.0_60/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins/

8. configure control security
/opt/jdk1.8.0_60/bin$ sudo sh ControlPanel



Reference: 
http://askubuntu.com/questions/159575/how-do-i-make-java-default-to-a-manually-installed-jre-jdk






Wednesday, January 15, 2014

Update JRE Java on ubuntu (java version "1.7.0_51")

1. Download Java
2. Install Java from website
or
3. Install java from website
4. กรณีเปิดใน Firefox แล้วแจ้ง Error: application blocked by security settings   ให้แก้ไขใน Firefox ดังนี้
vim /etc/apparmor.d/abstractions/ubuntu-browsers.d/java
 ---------------------------------------------Start------------------------------------
 # Java plugin
  owner @{HOME}/.java/deployment/deployment.properties k,
  /etc/java-*/ r,
  /etc/java-*/** r,
#  /usr/lib/jvm/java-6-openjdk*/jre/lib/*/IcedTeaPlugin.so mr,
#  /usr/lib/jvm/java-6-openjdk/jre/bin/java cx -> browser_openjdk,
#  /usr/lib/jvm/java-6-openjdk-{amd64,armel,armhf,i386,powerpc}/jre/bin/java cx -> browser_openjdk,
#  /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,
  /usr/lib/j2*-ibm/jre/bin/java cx -> browser_java,

  /opt/java/32/jre1.7.*/bin/java{,_vm} cx -> browser_java,
  /opt/java/32/jre1.7.*/lib/*/libnp*.so cx -> browser_java,


ปล. เปลี่ยน Path java ให้กับ Browser ใหม่เพราะมันลิ้งไปที่ตัวเดิม
-----------------------------------------------Finish------------------------------------
Ref: apparmor