How to install java in Linux mint

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




how to install java in linux mint, how to install java in ubuntu, 


1 :- First download java from official site "Download java




2 :- Then install java 


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

3. Open up the Terminal

 (Alt + F2 > Terminal).

4. Remove OpenJDK installation.


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

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

6. Change directory into one with downloaded tarball. 

In my case $HOME/Downloads.

cd ~/Downloads

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

tar -zxvf jdk-

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

sudo mkdir -p /opt/java

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

sudo mv jdk1.7.0_27 /opt/java

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

11. 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/



Comments