They offer different flash templates with latest features.

Forgot password
Written by:
Score: 32
votes: 40
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: 2 years ago.
Last edited: 2 years ago.
Reviewed: 2 years ago.
Read 0 times.

5 days ago

Thanks a lot. Worked perfectly :)  
2 months ago

Excellent tutorial...worked perfectly on LMDE
thank you
2 months ago

Thank you. I successfully installed but the last step 9 plug in Mozzila , i didn't understand. What is purpose of that?  
4 months ago

Check out this method:
4 months ago

your instructions are not that good. Any one cant understand what you said thus can not completely install jdk with out any problems . just copy paste wont work so its not a good one  
5 months ago

Second the comment from sbrbot.
This guide works good but the other is easier to maintain.
8 months ago

Here is another (I must say better) article about how to install Oracle JDK because it suggest creating "current-java" folder which allows easier upgrade of JDK version.
8 months ago

You need another sudo in first command

sudo apt-get update && sudo apt-get remove openjdk*
9 months ago

New JDK Version

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

tar -zxvf #your current version download file name#
my version is " jdk-7u79-linux-x64.tar.gz "
I need to type:
tar -zxvf jdk-7u79-linux-x64.tar.gz

7. Move extracted folder to /opt/java. In my case, version number was 1.7.0_25.
Make sure you check your current version, in my case as 4/24/2015, the current version is 1.7.0_79. Again, replace the 1.7.0_25. with 1.7.0_79.

-------date of comments --- is 04/26/2015----------------
11 months 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/
1 year ago

Wow this is exactly what solved my problem!! Thanks! :D  
1 year ago

you can automate this task with this script  
1 year 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.  
1 year ago

This is complete tutorial and works fine!
I recoment this to all of you!
1 year 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?
1 year 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
1 year 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.
1 year ago

Thanks. Great tutorial.

OBS: The plugin folder should be ~/.mozilla/plugins instead of ~/.mozzila/plugins.
1 year 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!
1 year ago

Needed the assist for correct commands.
1 year ago

Thanks, this helped me too!! :D  
2 years ago

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

Good Tutorial Thanks my friend  
2 years 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/"
2 years 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.

2 years ago

Thanks! just what I wanted!  
2 years 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.

2 years 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?
2 years ago

You are C*azy ...  

Other tutorials from dudko

No other tutorials.