How to install JDK1.5 under Linux

  
 

1. Download the latest JDK1.5 for Linux 64, the latest version is: jdk-1_5_0_22-linux-amd64.bin download path http://java.sun.com/javase/downloads/5u22/jdk (non-RPM Version)

2. Unzip to /opt/and create a soft link to the directory /opt/jdk -> jdk1.5.0_22/

3. Use the update-alternatives command , the system default java command points to the newly installed JDK to view the installed version of the Java version of the system
update-alternatives --display java

manually join our own installed java, and specify the priority is higher than the default (60 and 40 is manually assigned priority)
update-alternatives --install /usr/bin/java java /opt/jdk/bin/java 60update-alternatives --install /usr/bin/java java /usr/lib/Jvm/jre-1.6.0-openjdk.x86_64/bin/java 40

Set the Java command to the default for the newly installed JSDK
update-alternatives --config java

View the installed Javac version of the system
update-alternatives --display javac

Manually add our own installed javac and assign priority to the default
update-alternatives --install /usr/bin/javac javac /op t/jdk/bin/javac 60

Set the Javac command to default to the newly installed JSDK
update-alternatives --config javac

Copyright © Windows knowledge All Rights Reserved