How to install Java on linux?
Submitted by Ahmed Hashim on Wed, 2005-09-14 20:59.
In this article, you will learn how to install Java on Linux platforms.
*Download Java SDK from http://java.sun.com/j2se/1.5.0/download.jsp
**Click Download JDK 5.0 Update 6
**__Review__ then accept the license agreement
**download the "self-extracting file"
*Install Java SDK:
Open new shell
type su to login as root
{{{
$cd ''Download Directory''
$chmod +x jdk-1_5_0_06-linux-i586.bin
$./jdk-1_5_0_06-linux-i586.bin
}}}
press enter till finish the agreement
and type y to start installation.
you will find it installed on /usr/java/jdk1.5.0_06
*set Java Environment Variables
{{{$vi /etc/profile }}}
press __i__ for insert
then insert those commands
{{{
export JAVA_HOME=/usr/java/jdk1.5.0_06
export PATH=$PATH:$JAVA_HOME/bin
}}}
then __wq__ for save \\
Replace the directory above with the correct directory according to your system.\\
''Note:'' You will need to logout or reboot depending on your system
*Test Java version
If you want to know the current java version type
{{{$java -version}}}
you should see
{{{
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
}}}
\\
*If you have JPackage installed then you have to make Sun JDK the default by specifying an alternatives
{{{
$/usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.5.0_06/bin/java 500
$/usr/sbin/alternatives --install /usr/bin/javac javac /usr/java/jdk1.5.0_06/bin/javac 500
$/usr/sbin/alternatives --config java "Choose SUN SDK"
$/usr/sbin/alternatives --config javac "Choose SUN SDK"
}}}
*To enable applet viewer on FireFox
{{{
$ln -s $JAVA_HOME/jre/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/firefox-1.0.7/plugins/libjavaplugin_oji.so
}}}
''Note'': Adjust the Firefox directory to your installation directory
\\
Now [fully test your JVM|http://www.java.com/en/download/help/testvm.xml] \\
[Find more about installing java on linux |http://www.java.com/en/download/help/5000010500.xml]





