How to install java on Linux?
================================================
Hi Friends. Installing Java on windows machine is very easy but when we have to install on Linux machine , it seems a tedious or tough task. It happened with me also. I went through many blogs but didn't find easy steps. So,in this blog I have tried to make it very simple to install java on linux.
1) Go to following link:
2) Download the jdk-X-linux-Y-.tar.gz file.
Here X- Java Version
Y- Linux arch.(i586-32bit, x64-64bit).
3) As root user, create a directory as
# mkdir /usr/java
4) Move the downloaded file in /usr/java.
5) Extract the tar.gz file as
# tar -zxvf jdk-X-linux-Y-.tar.gz
It will create a directory with jdkXXX name in /usr/java.
6) Open /etc/profile. Add following lines and save the file.
JAVA_HOME=/usr/java/jdkXXX;
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH;
export PATH
7) For existing session do as
# source /etc/profile
To bring it in effect for all users , restart the Linux machine.
8) Check java version as
# java -version
It should reflect the current version of java.