
This post is a quick how-to for installing Oracle Java 8 on Ubuntu.
Java enables cross-platform application development and deployment, supporting a wide variety of platforms from embedded devices through to enterprise servers.
Oracle Java 8 will continue to receive regular updates through until at least December 2020, and is supported through until March 2025.
To install Oracle Java 8, complete the following steps:
- Add the WebUpd8 Java repository to the sources list, using the following command:
sudo add-apt-repository -y ppa:webupd8team/java
Package lists will be updated automatically. - Launch the Oracle Java 8 Installer, using the following command:
sudo apt-get install -y oracle-java8-installer
The Oracle Binary Code License Agreement for the Java SE Platform Products and JavaFX message is displayed.
┌───────────────────────────────┤ Configuring oracle-java8-installer ├───────────────────────────────┐ │ │ │ Oracle Binary Code License Agreement for the Java SE Platform Products and JavaFX │ │ │ │ │ │ │ │ You MUST agree to the license available in http://java.com/license if you want to use Oracle JDK. │ │ │ │ <Ok> │ │ │ └────────────────────────────────────────────────────────────────────────────────────────────────────┘
- Select
<Ok>
and press Enter. The Do you accept the Oracle Binary Code license terms? prompt is displayed.
┌─────────────────────────────────────────────────────────┤ Configuring oracle-java8-installer ├─────────────────────────────────────────────────────────┐ │ │ │ In order to install this package, you must accept the license terms, the "Oracle Binary Code License Agreement for the Java SE Platform Products and │ │ JavaFX ". Not accepting will cancel the installation. │ │ │ │ Do you accept the Oracle Binary Code license terms? │ │ │ │ <Yes> <No> │ │ │ └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
- Select
<Yes>
and press Enter. The download and installation process will begin. - Once complete, you can confirm the installed version of Java using the following command:
java -version
This command produces output similar to the following:
java version "1.8.0_171" Java(TM) SE Runtime Environment (build 1.8.0_171-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
Oracle Java 8 is now installed and ready for use.
Ubuntu is a trademark of Canonical Ltd. Oracle and Java™ are trademarks of the Oracle Corporation.
How to install Oracle Java 8 on Ubuntu