They offer different flash templates with latest features.

Forgot password
Written by:
Score: 22
votes: 28
Format: Article

 How to install Oracle JDK on Linux Mint

Unlinke JRE, Java Development Kit includes various development tools like the Java source compilers, bundling and deployment tools, debuggers, development libraries, etc.

Tutorial about How to install JRE for Linux Mint is almost identical for JDK.

Mint comes with a OpenJDK version of java libraries, which shouldn't be used for example Android development. [1]

1. Open up the Terminal (Alt + F2 > Terminal).

2. Remove OpenJDK installation.

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

3. Download Oracle JDK from here. You are looking for a linux version with tar.gz extension. Also choose the right version from 32-bit (x86)  and 64bit (x64) one.

4. Change directory into one with downloaded tarball. In my case $HOME/Downloads.

cd ~/Downloads

5. Extract tarball. Replace with a name of dowloaded file. (just press Tab and it will be autocompleted.)

tar -zxvf jdk-

6. As a root create a folder in /opt where jdk will be stored.

sudo mkdir -p /opt/java

7. Move extracted folder to /opt/java. In my case, version number was 1.7.0_25.

sudo mv jdk1.7.0_25 /opt/java

8. Make JDK system default.

sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/jdk1.7.0_25/bin/java" 1
sudo update-alternatives --set java /opt/java/jdk1.7.0_25/bin/java

9. Test installed java version.

$ java -version
java version "1.7.0_25" Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

Optinaly install firefox plugin by linking file to ~/.mozzila/plugins folder.

mkdir -p ~/.mozzila/plugins
ln -s /opt/java/jdk1.7.0_25/jre/lib/amd64/ ~/.mozzila/plugins/

Tags: java jdk oracle firefox plugin
Created: 1 year ago.
Last edited: 1 year ago.
Reviewed: 1 year ago.
Read 0 times.

3 weeks ago

Commands specific for jdk-8u40-linux-x64

sudo apt-get update && sudo apt-get remove openjdk*
tar -zxvf jdk-8u40-linux-x64.tar.gz
sudo mkdir -p /opt/java
sudo mv jdk1.8.0_40 /opt/java
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/jdk1.8.0_40/bin/java" 1
sudo update-alternatives --set java /opt/java/jdk1.8.0_40/bin/java
ln -s /opt/java/jdk1.8.0_40/jre/lib/amd64/ ~/.mozzila/plugins/
2 months ago

Wow this is exactly what solved my problem!! Thanks! :D  
3 months ago

you can automate this task with this script  
3 months ago

Fantastic, thanks. I also re-used your step 8 to set javac, the java compiler, for use in IDEs when programming in Java (IntelliJ and JBoss). Cheers.  
4 months ago

This is complete tutorial and works fine!
I recoment this to all of you!
5 months ago

Please add ´sudo´ in the first line for the second command. It should be: ´sudo apt-get update && sudo apt-get remove openjdk*´. Otherwise you'll get this error:

E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
5 months ago

Here is a more complete version:

This version:
* Allows for easy updating
* Updates more of the various jdk executables (ie: jar, keytool, servertool, etc)
* Has a fancy helper tool to help with the 'update-alternatives' commands!
* Does not allow for multi-versioning by default but you can modify the guide to make it so
7 months ago

I just followed the procedure and found out that the plugin folder is /usr/lib/mozilla/plugins
I am running a fresh install of LinuxMint 17

When I followed the procedure above the java plugin didn't appear when testin it with entering "about:plugins" into the address bar of firefox. Placing the link to into /usr/lib/mozilla/plugins made the java plugin show up on the "about:plugins" page.
8 months ago

Thanks. Great tutorial.

OBS: The plugin folder should be ~/.mozilla/plugins instead of ~/.mozzila/plugins.
11 months ago

Great! Concise and to the point. Thank you!

Note that I think you need a 2nd sudo in the JDK removal command set.

Big help for a noob like me! Thanks again!
11 months ago

Needed the assist for correct commands.
11 months ago

Thanks, this helped me too!! :D  
1 year ago

Hi, I am new on linux Mint and this step-by-step helped to set Java and Javac. Thaanks guys.  
1 year ago

Good Tutorial Thanks my friend  
1 year ago

Hi all,
Since we're installing the developer kit, it might be interesting to add links for the developer tools as well :
sudo update-alternatives --install "/usr/bin/javac" "javac" "/opt/java/jdk1.7.0_25/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javadoc" "javadoc" "/opt/java/jdk1.7.0_25/bin/javadoc" 1

Plus, you will usually need to add the following line to .bashrc :
export JAVA_HOME="/opt/java/jdk1.7.0_25/"
1 year ago

Thank you for this great tutorial. Worked perfectly for me.

Noticed one tiny thing. should be .mozilla with one "z" and two "ll". Afraid that is the limit of my abilty to contribute.

1 year ago

Thanks! just what I wanted!  
1 year ago

Thanks a lot Dudko for this tutorial, I used the same steps above and removed the OpenJDK because I needed to open JNLP files for my work applications, and there was IcedTea installed with Mint, removing OpenJDK and installing Oracle JDK worked perfectly with Mozilla Firefox, I needed to use Socks protocol, it did not work with IcedTea, but worked automatically with Oracle Java Plugin.

1 year ago

dear dudko,

many thanks for the post. i am a newbie and would like some help on your posting please. i did what you stated above, but the javac does not work. it says i have install this. any idea how to fix this?
1 year ago

You are C*azy ...  

Other tutorials from dudko

No other tutorials.