In case you need Oracle Java instead of OpenJDK in Ubuntu, here's how you can install it via a PPA:
Note that the PPA doesn't host Oracle Java 7 as this not allowed by
the new Java license (which is also the reason why it has been removed
from the official Ubuntu repositories in the first place). The package
in the PPA simply downloads Oracle Java JDK 7 from its official website
and installs it on your machine.
To test if the installation is completed successfully, execute:
If for some reasons, the Java installed is not version 1.7.x, execute the following command to force an update:
To automatically set up the Java 7 environment variables, install the following package:
