I'm trying to install openjdk-7 on my ubuntu but I'm getting the following error:
$ sudo apt-get install openjdk-7-jre
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package openjdk-7-jre 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
E: Package openjdk-7-jre has no installation candidate
I suppose I'm missing some repos or something like that but I was unable to find any reference where and what.
Install OpenJDK 15 Released on 15 September 2020, the OpenJDK 15 is the latest feature release of JDK. But it is not the part of Ubuntu 20.04 base repository. To install OpenJDK 15, download its Debian package from the Oracle official website (https://www.oracle.com/java/technologies/javase-jdk15-downloads.html).
I recently had to install Java 7 on CentOS, openSUSE and Ubuntu, and after much fretting and research, finally settled on this, which works on all three flavors:
Obviously, you'll have to fill in some blanks here, but you should get the picture. As a working example, here is my installation (note that for my purposes I needed both the 64-bit AND 32-bit versions of both the Java 7 AND Java 6 JDKs, so there's a lot):
# ls -al /usr/java/
total 24
drwxr-xr-x 6 root root 4096 Sep 2 11:02 .
drwxr-xr-x 14 root root 4096 Aug 9 22:14 ..
lrwxrwxrwx 1 root root 16 Aug 26 20:05 default -> /usr/java/latest
drwxr-xr-x 8 root root 4096 Sep 2 10:52 jdk1.6.0_35
drwxr-xr-x 8 root root 4096 Sep 2 10:52 jdk1.6.0_35-32
drwxr-xr-x 8 root root 4096 Sep 2 10:52 jdk1.7.0_07
drwxr-xr-x 8 root root 4096 Sep 2 10:52 jdk1.7.0_07-32
lrwxrwxrwx 1 root root 11 Sep 2 10:54 jdk6 -> jdk1.6.0_35
lrwxrwxrwx 1 root root 14 Sep 2 10:54 jdk6-32 -> jdk1.6.0_35-32
lrwxrwxrwx 1 root root 11 Sep 2 10:54 jdk7 -> jdk1.7.0_07
lrwxrwxrwx 1 root root 14 Sep 2 10:54 jdk7-32 -> jdk1.7.0_07-32
lrwxrwxrwx 1 root root 4 Sep 2 10:55 latest -> jdk7
# ls -al /usr/bin/java*
lrwxrwxrwx 1 root root 26 Aug 26 20:05 /usr/bin/java -> /usr/java/default/bin/java
lrwxrwxrwx 1 root root 27 Aug 26 20:05 /usr/bin/javac -> /usr/java/default/bin/javac
lrwxrwxrwx 1 root root 29 Aug 26 20:05 /usr/bin/javadoc -> /usr/java/default/bin/javadoc
lrwxrwxrwx 1 root root 27 Aug 26 20:07 /usr/bin/javah -> /usr/java/default/bin/javah
lrwxrwxrwx 1 root root 28 Aug 26 20:05 /usr/bin/javaws -> /usr/java/default/bin/javaws
# java -version
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With