1. Download the Java SE Development Kit from http://www.oracle.com/technetwork/java/javase/downloads/index.html. Select the tarball (".tar.gz" file extension) for the appropiate architecture (32 or 64 bits).
For this explanation, I suppose the file is downloaded to "Downloads" directory of the "username" home directory ("/home/username/Downloads/").
2. As a root user, move the downloaded file to the installation directory and unpack the tarball.
$ suIn this step, Java was unpacked on "/usr/java/" directory. Now, you can remove the downloaded file:
Password: <Type the root password>
# mkdir /usr/java/
# cd /usr/java/
# mv /home/username/Downloads/jdk-<version>-linux-<arch>.tar.gz .
# tar -zxvf jdk-<version>-linux-<arch>.tar.gz
# rm jdk-<version>-linux-<arch>.tar.gz3. Create a symbolic link to the JDK installation directory.
# ln -s /usr/java/jdk<version> default4. Set the "JAVA_HOME" environment variable.
# cd /etc/profile.d/5. Set the JDK tools in "PATH" environment variable.
# cat >> java.sh
export JAVA_HOME=/usr/java/default
<CTRL + C>
#
# cd /etc/
# cat >> bash.bashrc.local
PATH=$JAVA_HOME/bin:$PATH
export PATH
<CTRL + C>
#
No comments:
Post a Comment