From Michael's Pluskat box notes
Download the latest JDK from http://java.sun.com/javase/downloads/index.jsp and proceed with
the installation as follows
Code: Select all
yum -y install libstdc++-296 compat-libstdc++-33
mv jdk-6u3-linux-i586.bin /opt
cd opt; chmod +x jdk-6u3-linux-i586.bin
./jdk-6u3-linux-i586.bin # accept the license agreement
rm -f jdk-6u3-linux-i586.bin
Create and edit /etc/profile.d/java.sh and add the following
Code: Select all
export JAVA_HOME=/opt/jdk1.6.0_03
export PATH=$JAVA_HOME/bin:$PATH
Add the above variables to your current session
Code: Select all
source /etc/profile
Confirm Java is installed
Code: Select all
[root@localhost ~]# which java
/opt/jdk1.6.0_03/bin/java
Check if GCJ is installed (GNU compiler for Java - usually Red Hat systems install this by default)
Code: Select all
alternatives --config java
If it returns nothing then proceed with the next step and install it as 1 (the value shown on the end),
else if there is an entry already listed as 1 then proceed and install it as 2.
Install it systemwide
Code: Select all
alternatives --install /usr/bin/java java /opt/jdk1.6.0_03/bin/java 1
Confirm again
Code: Select all
[root@localhost ~]# alternatives --config java
There is 1 program that provides 'java'.
Selection Command
-----------------------------------------------
*+ 1 /opt/jdk1.6.0_03/bin/java
[root@localhost ~]# alternatives --display java
java - status is auto.
link currently points to /opt/jdk1.6.0_03/bin/java
/opt/jdk1.6.0_03/bin/java - priority 1
Current `best' version is /opt/jdk1.6.0_03/bin/java.
And lastly for the Java compiler (javac)
Code: Select all
[root@localhost ~]# which javac
/opt/jdk1.6.0_03/bin/javac