Easy way to install Oracle Java on Ubuntu

oracle-java-on-ubuntu
The default Java packages (JRE and JDK) on Ubuntu come from the OpenJDK project. Sometimes we need to use specifically a Oracle Java SE Runtime (JRE) Environment or Oracle Java SE Development Kit (JDK) package on our Ubuntu Desktop or Ubuntu Server and a manual installation on paths like /opt or /usr/local paths isn’t a elegant or clean solution, other than that, you will not receive new package updates.

An easy way to install the Oracle JDK and the Oracle JRE and receive software updates of those packages is by add a repository with installation packages to our system with those instructions:

The following commands add the new apt repository and update the local list of packages:

Now you can choose a version to install, at the moment of this post was written there are Oracle Java 6, Oracle Java 7, Oracle Java 8 and Oracle Java 9 versions:

You don’t need to uninstall the OpenJDK packages that sometimes is needed by other packages as dependencies. Instead you can configure the system to use as default all the Java executables (e.g. javajavac, javadoc, javap and javaws) from a specific installed JRE or JDK with the following commands:

To list the installed Java packages:

To use a specific installed java package:

Now you confirm that the Java executables are used from the chosen Java package:

Done!

With those instructions, you will receive new versions of the Java packages through the normal software updates of your Ubuntu operation system.

Enjoy!

References:
Launchpad WebUpd8 team
WikiHow

Differences between Eclipse Juno 3.8 and 4.2

Eclipse JunoThe Eclipse Juno simultaneous release included both the Eclipse Juno 4.2 and the Eclipse Juno 3.8 versions of the Eclipse Application Platform (confusing, but true).

The 4.2 release is a mature platform release containing significant new feature work, while the 3.8 release focuses on stability and bug fixes.

That said, you can download the Eclipse Platform 3.8 and then install the Juno packages you want.