The problem is that the default-jre
package depends on OpenJDK 6 and most other packages have their dependencies defined as default-jre | openjdk-6-jre | sun-java6-jre
- so until OpenJDK 7 becomes officially supported and will be used as the default version, or until all Java-dependent packages update their dependencies, you'll have to keep OpenJDK 6 around and set the OpenJDK 7 as default using update-java-alternatives
. Example for 64-bit system:
$ update-java-alternatives -l
java-1.6.0-openjdk 1061 /usr/lib/jvm/java-1.6.0-openjdk
java-1.7.0-openjdk-amd64 1051 /usr/lib/jvm/java-1.7.0-openjdk-amd64
$ sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
On 32-bit system the directory name will differ, you can find the right name using the -l
switch. The second command may spit a lot of errors; either use --jre
switch or just ignore errors – the script changes what it can and just ignores the rest.
One could theoretically edit the default-jre
package to depend on OpenJDK 7, but be warned that this can cause more harm than good.
default-jre
This is a simple package which depends on openjdk-7-jre (and so is basically equivalent to openjdk-7-jre) and default-jre-headless. It installs the "Standard Java or Java compatible Runtime", which is OpenJDK 7 JRE.
This package points to the Java runtime, or Java compatible runtime recommended for the i386 architecture, which is openjdk-7-jre for i386.
Package information
Package dependencies (saucy)
ecj
This is the "standalone Eclipse Java compiler". Installing it will not install Eclipse, as it is a standalone package (see dependencies link below). It contains "a standalone version of the Eclipse JDT compiler which is distributed as part of Eclipse" and is compatible with Java 1.3 through to 1.7.
This package provides a standalone version of the Eclipse JDT compiler which is distributed as part of Eclipse. It passes the JCK (Java Compatibility Kit) and is compatible with Java 1.3, 1.4, 1.5, 1.6 and 1.7.
Package information
Package dependencies (saucy)
gcj-4.6-jdk
(gcj-4.7-jdk is the same but for Java 7)
This is a frontend to the GCC compiler to natively compile Java bytecode and source files.
GCJ is a front end to the GCC compiler which can natively compile both Java(tm) source and bytecode files. The compiler can also generate class files. Other java development tools from classpath are included in this package.
The package contains as well a collection of wrapper scripts and symlinks. It is meant to provide a Java-SDK-like interface to the GCJ tool set.
It was meant to be an open source alternative to the closed source Oracle Java compiler. It seems to be mostly obselete and outdated (not updated) now, see links below (particularly the last updates on the GCJ home page).
Package information
Is GNU's Java Compiler (GCJ) dead? - Stack Overflow
GCJ home page on gnu.org (Update: The link is gone now, but GCJ wiki is still available
openjdk-6-jdk
(openjdk-7-jdk is the same but for Java 7)
An open source version of the Java platform.
From the Wiki:
The primary goal of the OpenJDK project is to produce an open-source implementation of the Java SE Platform (6 and 7). This is the default version of Java that Ubuntu uses and is the easiest to install.
Package summary:
OpenJDK is a development environment for building applications,
applets, and components using the Java programming language.
The packages are built using the IcedTea build support and patches
from the IcedTea project.
Package information
Also, not mentioned in your question was Oracle Java (because it isn't in the default repos), which I'll list below for completeness
oracle-java7-installer
(package name from Web Up8 PPA, distributed by Oracle in .tar.gz)
The closed source 'official' implementation of Java by Oracle (previously Sun). Not hosted in the official repos due to licensing issues. It was made available by Web Up8 as a script which downloads and installs it for you.
How to install - Web Up8
Best Answer
This is because those packages will become OpenJDK 11 when that is released. See this mailing list post:
That's also why the source package of
openjdk-11-*
is actually calledopenjdk-lts
.A bug report has been filed - please subscribe to it (but don't comment unless you have new information to add, which is unlikely). An Ubuntu dev, Jeremy Bicha, has responded:
A new bug report has been opened for tracking all changes that need to be made, and there are a lot of them - a rough count of 140. Excerpts from the bug report:
And another Ubuntu dev, Tiago Stürmer Daitx noted:
Still no ETA at present. Quite a few packages have been updated and added to the various PPAs maintained by the transition team, so if you wish to help out with testing, do check them out.
Update 17 April 2019:
It seems that fix has been released. Now
apt show openjdk-11-jdk
shows:And the output of
java -version
is: