Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

How do I install JDK 1.5?

Writer Andrew Mclaughlin

I am getting this error when trying to install java 1.5 JDK

sudo apt-get install sun-java5-jdk
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package sun-java5-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it: apt:i386 apt
E: Package 'sun-java5-jdk' has no installation candidate
2

1 Answer

Download JDK 5

Create directory for JDK:

sudo mkdir /usr/lib/jvm/java5

Extract archive in a new folder:

sudo tar xf java5.tar.gz -C /usr/lib/jvm/java5

Now run:

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/java5/jdk1.5.0/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/java5/jdk1.5.0/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/java5/jdk1.5.0/bin/javaws" 1

Correct the file ownership and the permissions of the executables:

sudo chmod a+x /usr/bin/java
sudo chmod a+x /usr/bin/javac
sudo chmod a+x /usr/bin/javaws
sudo chown -R root:root /usr/lib/jvm/java5/jdk1.5.0

Check if it successful:

java -version
8

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy