Setup java in linux

1st way –

2nd way –

After the installation finishes, if you wish to see if it was successful, you can run the following command:

3rd way –

If you download a .tar.gz-file of java to install then – [ Here is my version is jdk1.7.0_02 ]
extract the .tar.gz-file and enter into that folder under which you extract the .tar file
Second move it to the correct directory because of this you need to create a jvm folder into lib folder so type in terminal-

Then follow the following code –

After this you will see some screen like below or may be you will see some text called auto mode

Selection Path Priority Status
*0 /usr/lib/jvm/java-6-sun/jre/bin/java 63 auto mode
1 /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode
2 /usr/lib/jvm/jdk1.7.0_02/jre/bin/java 1 manual mode

If you see any error msg in your terminal don’t be panic just follow the steps below-

There is also compiler to install –

Close firefox –

Maybe you want to add a symlink:

To check java in terminal – java -version

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.