понедельник, 24 февраля 2014 г.

Ubuntu - install Sun Java and browser plugin

Install Java

Since Oracle Java is no longer currently available in a supported Ubuntu repository, one should go to Java download page and download tgz archive. Currently the latest version is 7 update 51.
Assuming you downloaded it to ~/Download/jre-7u51-linux-x64.tar.gz:
sudo mkdir -p /usr/lib/jdk/
cd /usr/lib/jdk/
sudo tar xzf ~/Download/jre-7u51-linux-x64.tar.gz
sudo update-alternatives --install "/usr/bin/java"   "java"   "/usr/lib/jdk/jdk1.7.0_51/bin/java"   0
sudo update-alternatives --install "/usr/bin/javac"  "javac"  "/usr/lib/jdk/jdk1.7.0_51/bin/javac"  0
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jdk/jdk1.7.0_51/bin/javaws" 0
You may also need to configure java alternatives (in case you have several java versions installed):
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws

Install browser (chrome) plugin

See official page for up-to-date instructions or perform these commands:
  1. Become the root user by running the su command and then enter the super-user password.
    sudo -s
  2. Create a directory called plugins if you do not have it.
    mkdir -p /opt/google/chrome/plugins
  3. Go to Google chrome plugins directory before you make the symbolic link.
    cd /opt/google/chrome/plugins
  4. Create a symbolic link.
    ln -s /usr/lib/jdk/jdk1.7.0_51/jre/lib/amd64/libnpjp2.so .
  5. Restart your browser and test Java

Open jnlp files from webpages with javaws

Go to the webpage with jnlp application. Start the application and the browser will download the jnlp file. Click the arrow next to the file button in the downloads bar and select "Always open files of this type". Start the application again to see the effect.