Installing jdk 1.5 on ubantu
Here uou can keep multiple versions of Java (JRE and JDK) at a time and choose between them which one to use.
on the below link download your version of Java.
http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase5-419410.html
I have download the following file;
Java Development Kit 5.0 Update 22 42.14 MB jdk-1_5_0_22-linux-amd64.bin
Go to the termial and go the the path where you downloaded the file.
type the following command;
sudo mv jdk-1_5_0_22-linux-amd64.bin /usr/lib/jvm
cd /usr/lib/jvm
chmod +x jdk-1_5_0_22-linux-amd64.bin
sudo ./jdk-1_5_0_22-linux-amd64.bin
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.5.0_22/bin/java" 2
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.5.0_22/bin/javac" 2
You have installed the jdk 1.5 Successfully
If you two verions of jdk you can use following commands to switch them
sudo update-alternatives --config java
sudo update-alternatives --config javac
Confirm the version of Java currently in use with these commands:
java -version
javac -version
Cheers!!!