This morning, I tried to install something and came across a statement like this:
The program 'javac' can be found in the following packages:
* default-jdk
* ecj
* gcj-4.6-jdk
* gcj-4.7-jdk
* openjdk-7-jdk
* openjdk-6-jdk
Try: sudo apt-get install <selected package>
What is the difference between default-jdk, ecj, gcj and openjdk?
Thanks in advance.
Best Answer
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.
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.
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.
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:
Package summary:
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