How to install Oracle JDK on Linux Mint (debian)

Primary tabs

How to install Oracle JDK on Linux Mint (debian)

Topic: 
System Administration

1. Remove the current JDK installation:

 

sudo apt-get update && apt-get remove openjdk*

 

2. Download Oracle JDK from here. Get the tar.gz file for the right version 32 or 64 bit.

 

3. Untar it under /opt, and create a symlink from /opt/java to it

 

tar xvpfz jdk-8u101-linux-x64.tar.gz


ln -sf jdk1.8.0_101 java

 

4. Register the default 'java' and 'javac' command to use the new JDK:

 

update-alternatives --install "/usr/bin/java" "java" "/opt/java/bin/java" 1
update-alternatives --set java /opt/java/bin/java
update-alternatives --install "/usr/bin/javac" "javac" "/opt/java/bin/javac" 1
update-alternatives --set javac /opt/java/bin/javac

 

5. Install the firefox plugin to run applets:

 

cd $HOME

mkdir -p .mozilla/plugins

cd .mozilla/plugins

ln -sf /opt/java/jre/lib/amd64/libnpjp2.so

 

 

 

security: