Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing openjdk-7-jre on ubuntu 10.04 - Package openjdk-7-jre has no installation candidate [closed]

Tags:

java

ubuntu

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.

like image 206
Robert Grezan Avatar asked May 06 '12 15:05

Robert Grezan


People also ask

How do I download OpenJDK 15 on Ubuntu?

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).


1 Answers

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:

  • Ignore (and uninstall) any JREs or JDKs bundled with / shipped with your distribution. They are more trouble than they're worth, and always way behind the latest updates.
  • Download JRE 7 (or JDK 7 if you want to develop) from http://www.oracle.com/technetwork/java/javase/downloads/index.html.
    • For the JRE, get jre-xxx-linux-x64.tar.gz if you have a 64-bit machine or jre-xxx-linux-i586.tar.gz if 32-bit. Don't bother with the RPMs.
    • For the JDK, get jdk-xxx-linux-x64.tar.gz if you have a 64-bit machine or jdk-xxx-linux-i586.tar.gz if 32-bit.
  • Perform the following as root or using sudo:
    • # tar -xzvf jdk-xxx-linux-x64.tar.gz (or whichever one you downloaded)
    • # mkdir /usr/java
    • # mv jdkx.x.x_xx /usr/java (or, if JRE, this will be the extracted JRE directory)
    • # ln -s /usr/java/jdkx.x.x_xx /usr/java/jdkx
    • # ln -s /usr/java/jdkx /usr/java/latest
    • # ln -s /usr/java/latest /usr/java/default
    • # ln -s /usr/java/default/bin/java /usr/bin/java
    • # ln -s /usr/java/default/bin/javac /usr/bin/javac
    • # ln -s /usr/java/default/bin/javah /usr/bin/javah
    • # ln -s /usr/java/default/bin/javadoc /usr/bin/javadoc
    • # ln -s /usr/java/default/bin/javaws /usr/bin/javaws

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)
like image 182
Nick Williams Avatar answered Sep 19 '22 09:09

Nick Williams