INTRODUCTION
This post will be the step by step guide to install the JDK in Linux Platform.
DOWNLOAD
Download jdk-7u79-linux-x64.tar.gz file the oracle website.
INITIAL SETUP
Create a new folder 'java' under /usr
UNZIP THE DOWNLOADS
Unzip jdk-7u79-linux-x64.tar.gz to /usr/java
Now the folder structure would be /usr/java/jdk1.7.0_79
SET JAVA_HOME
- Check already set or not => $ echo $JAVA_HOME
- If Not, => $ export JAVA_HOME=/usr/java/jdk1.7.0_79
- Check JAVA_HOME now => $ echo $JAVA_HOME
/usr/java/jdk1.7.0_79
SET CLASSPATH VARIABLE
- Check already set or not => $ echo $CLASSPATH
- If Not, => $ export CLASSPATH=$JAVA_HOME'\lib'
- Check CLASSPATH now => $ $ echo $CLASSPATH
/usr/java/jdk1.7.0_79\lib
SET PATH VARIABLE
- Check already set or not => $ echo $PATH
- If not, => $ export PATH=$JAVA_HOME'\bin'
by default there will be some PATH variable set already, then do as 6.4
- Check PATH now => $ $ echo $PATH
/usr/java/jdk1.7.0_79/bin
- If already PATH set, then $ export PATH=$PATH:$JAVA_HOME'/bin'
<existing path variables>:/usr/java/jdk1.7.0_79/bin
Now you will be able to run any java program in Linux. Please reply in comment box if you are facing any error during any of the above steps.
No comments :
Post a Comment