Thursday, August 23, 2012

How to Install and Configure JDK on Linux

Installing Sun JDK on Linux Installing Sun JDK on Linux. 

 Download the latest version of JDK from I have downloaded jdk-1_5_0_01-linux-i586.bin for this tutorial.

Change to the directory where you downloaded the SDK ( I downloaded it in my home directory /home/deepak) and make the self-extracting binary executable:
chmod +x jdk-1_5_0_01-linux-i586.bin

Run the self-extracting binary, this will display the License agreement text and will ask you to accept the agreement:

Above command should create a directory called jdk1.5.0_01 in the /home/pankaj directory. Move the SDK directory to /usr/java/ .Create /usr/java if it doesn't exist. Here is the command used:
mv jdk1.5.0_01 /usr/java

Set the JAVA_HOME environment variable, by modifying /etc/profile so it includes the following:
export JAVA_HOME

/etc/profile is run at startup and when a user logs into the system, so you will need to log out and log back in for JAVA_HOME to be defined.

Check to make sure JAVA_HOME is defined correctly using the command below. You should see the path to your Java SDK.


Output should be


1 comment: