They offer different flash templates with latest features.
Login

Forgot password
Register
Back
Written by:
dudko
Score: 12
votes: 17
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 libnpjp2.so file to ~/.mozzila/plugins folder.

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


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

Comments
1 month ago

DrScum
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 libnpjp2.so into /usr/lib/mozilla/plugins made the java plugin show up on the "about:plugins" page.
 
1 month ago

vici
Thanks. Great tutorial.

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

DrTubbyGooberman
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!
 
5 months ago

Bee1
Needed the assist for correct commands.
 
5 months ago

Jhonnux
Thanks, this helped me too!! :D  
7 months ago

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

rodro2013
Good Tutorial Thanks my friend  
9 months ago

martin_kirch
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/"
 
9 months ago

sweakley
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.

~/.mozzila/plugins/
 
9 months ago

micruma
Thanks! just what I wanted!  
10 months ago

muzaffar-omer
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.

Thanks
 
11 months ago

netwoky
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

zantaz
You are C*azy ...  

Other tutorials from dudko

No other tutorials.