Friday, July 30, 2010

How to install jdk1.6 on 64 bit linux machine?

JDK (Java Development Toolkit) :

It is a bundle of software that you can use to develop Java based applications. Java Development Kit is needed for developing java applications.

JRE (Java Runtime environment) :

It is an implementation of the Java Virtual Machine which actually executes Java programs. Java Run Time Environment is a plug-in needed for running java programs.

Here are the steps those I followed :

1. wget

Note : You can get the .bin file from the's site. Oracle is now the owner of sun. You can search the "download + jdk-6u21-linux-x64.bin" in google to get the binary.

2. chmod +x above_bin_file
3. ./above_bin_file
4. Now you'll see RPM file of JDK. So, execute the following command to install it:
root@server [/usr/local/src]# rpm -Uvh jdk-6u21-linux-amd64.rpm
Here is the installation path :

64 bit Java: /usr/java/64/ or /usr/java... (or /opt/java/64/...)
32 bit Java: /usr/java/... (or /opt/java/...)

4. Added JAVA_HOME path like :
root@server [/]# grep JAVA_HOME ~/.bash_profile
root@server [/]#

root@server [/]#export PATH=$PATH:/usr/java/64/jdk1.6.0_21/bin

root@server[/]# grep jdk ~/.bash_profile
export PATH=$PATH:/usr/java/64/jdk1.6.0_21/bin
You can do like :

echo "JAVA_HOME=/usr/java/jdk1.6.0_21" >> ~/.bash_profile
echo "export PATH=$PATH:/usr/java/jdk1.6.0_21/bin" >> ~/.bash_profile

6. Check the path(You may logout and login into the server) :

root@fre [/]# echo $JAVA_HOME

That's it. Try :)

No comments:

Post a Comment