Wednesday, February 10, 2016

Enable newly installed java for your favorite browsers

For Mozilla
64 bit Jdk
sudo ln -s /usr/lib/jvm/jdk1.8.0/jre/lib/amd64/libnpjp2.so /usr/lib/mozilla/plugins
32 bit jdk
sudo ln -s /usr/lib/jvm/jdk1.8.0/jre/lib/i386/libnpjp2.so /usr/lib/mozilla/plugins
For Chrome
64 bit jdk
sudo mkdir /opt/google/chrome/plugins
sudo ln -s /usr/lib/jvm/jdk1.8.0/jre/lib/amd64/libnpjp2.so /opt/google/chrome/plugins
32 bit jdk
sudo mkdir /opt/google/chrome/plugins
sudo ln -s /usr/lib/jvm/jdk1.8.0/jre/lib/i386/libnpjp2.so /opt/google/chrome/plugins

Install any oracle java in your Ubuntu 15.10

Step 1: Download the preferable jdk from oracle web site. Here we will use
            jdk version as jdk-8-linux-x64
Step 2: Keep the tar.gz file in a folder of your choice in /home/ directory.
Step 3: Extract the tar.gz file          
            tar -xvzf jdk-8-linux-x64.tar.gz

Step 4: Create JVM folder in /usr/lib folder like:            
            sudo mkdir /usr/lib/jvm

Step 5: Move the extracted jdk to the above location like :
            sudo mv jdk1.8.0 /usr/lib/jvm/jdk1.8.0

Step 6: Install new java sources in system like:
          sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8.0/bin/javac 1
          sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0/bin/java 1
          sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.8.0/bin/javaws 

Step 7: Choose default Java
          sudo update-alternatives --config javac
          sudo update-alternatives --config java
          sudo update-alternatives --config javaws

Step 8: Check the java version.
            java -version