Cannot install jdk 1.5 on Ubuntu 12.04
I have installed Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-23-generic x86_64). Some info about the machine:
$ grep --color "model name" /proc/cpuinfo
model name : Intel(R) Xeon(R) CPU E5430 @ 2.66GHz
model name : Intel(R) Xeon(R) CPU E5430 @ 2.66GHz
model name : Intel(R) Xeon(R) CPU E5430 @ 2.66GHz
model name : Intel(R) Xeon(R) CPU E5430 @ 2.66GHz
I need to install jdk5 to support an old application.
I have tried:
~$ sudo apt-get install openjdk-5-jdk
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package openjdk-5-jdk
I have also tried:
~$ sudo apt-get install sun-java5-jdk
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package sun-java5-jdk
So its not available in the repos. I have tried to follow this guide (adding the jaunty repos):
http://leonardo-pinho.blogspot.dk/2010/11/java-15-no-ubuntu-1010.html
but same result.
Then I have tried to download jdk-1_5_0_22-linux-i586.bin from here:
http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase5-419410.html#jdk-1.5.0_22-oth-JPR
and do:
~$ chmod a+x jdk-1_5_0_22-linux-i586.bin
~$ sudo ./jdk-1_5_0_22-linux-i586.bin
Sun Microsystems, Inc. Binary Code License Agreement
yes
Unpacking...
Checksumming...
0
0
Extracting...
./jdk-1_5_0_22-linux-i586.bin: 424: ./jdk-1_5_0_22-linux-i586.bin: ./install.sfx.19556: not found
./jdk-1_5_0_22-linux-i586.bin: 1: cd: can't cd to jdk1.5.0_22
Any suggestions?
Solution 1:
Two suggestions:
1) You try to install a 32-bit JDK (jdk-1_5_0_22-linux-i586.bin) on a 64-bit Linux (GNU/Linux 3.2.0-23-generic x86_64).
The JDK 1.5.0_22 Java installer (install.sfx.XXXXX
) needs these libraries to run (from my 32-bit Ubuntu 12.04):
$ ldd install.sfx.5362
linux-gate.so.1 => (0x004df000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x0022e000)
/lib/ld-linux.so.2 (0x00b96000)
which corresponds to package libc6-i386
. Install it (sudo apt-get install libc6-i386
) and try again.
2) Use the 64-bit JDK.
Solution 2:
Java 1.5 is so down rev, it is no longer officially supported by Oracle and because of licensing issues that hinder redistribution you cannot install it use apt-get
You can download an executable that will install Java 1.5 from the oracle.com site. On Oracle.com follow the Download links for Java Developers and click on Older (or Other) Releases
Then refer to this article which describes how to set up Java 1.6
When setting up the alternatives substitute 1.6 for 1.5
sudo update-alternatives --install \
"/usr/bin/java" "java" "/usr/lib/jvm/jdk1.5.0_22/bin/java" 1
sudo update-alternatives --install \
"/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.5.0_22/bin/javac" 1
Solution 3:
Yes, these packages are not found in Ubuntu 12.04 repositories. However, you can install any of these two packages:
$ sudo apt-get install openjdk-6-jdk
or
$ sudo apt-get install openjdk-7-jdk
To search for open-jdk package, you can use the following command:
$ apt-cache search openjdk