• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Source Digit

Source Digit

Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Instagram
  • Blogging
  • Android
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology
  • Write for Us
Home / Ubuntu / Install Oracle Java In Ubuntu Via PPA, with Apt-Get Command

Install Oracle Java In Ubuntu Via PPA, with Apt-Get Command

By Sourabh / November 3, 2016 Category: How To, Ubuntu

Install Java on Ubuntu with Apt-Get. Learn how to Install Java on Ubuntu using Terminal, using WebUpd8 Team Oracle Java (JDK) 7/8/9 PPA. OpenJDK is a free and open source implementation of the Java programming language.

Install OpenJDK

OpenJDK is a free and open source implementation of the Java programming language. It has support from the Oracle Corporation and serves as the reference implementation of Java SE (Standard Edition). It is the basis for the Oracle Java products. Some additional information about OpenJDK is at: http://openjdk.java.net/.

Run the following commands in Terminal to install OpenJDK on Ubuntu:

Installing JDK 9

sudo apt-get install openjdk-8-jre

Installing JDK 8

sudo apt-get install openjdk-8-jre

Installing JDK 7

sudo apt-get install openjdk-7-jre

Please note that the openjdk-jre package contains just the Java Runtime Environment. If you want to develop Java programs then you will have to install the openjdk-jdk package.

Install Oracle JDK/Java

Oracle JDK/Java is a proprietary implementation of the Java programming language from the Oracle Corporation. It is based on the OpenJDK with the addition of some closed-source components. Canonical no longer packages Oracle Java for Ubuntu due to licensing restrictions, but some older packages may require that the Oracle JDK be installed.

Ubuntu Linux users can install Oracle JDK/Java using WebUpd8 Tea: Oracle Java (JDK) 7/8/9 PPA. Run the following commands to install Oracle JDK/Java:

sudo add-apt-repository ppa:webupd8team/java
sudo apt update
sudo apt install oracle-java8-installer

To install Java 9, simply replace sudo apt install oracle-java8-installer with sudo apt install oracle-java9-installer.

Once installed, run the command below to check the version of Java:

javac -version

Setting Java Environment Variables

Installing Java isn’t complete without setting Java environment variables. To set Java environment variables, run the command:

sudo apt install oracle-java8-set-default

For Java 9, replace oracle-java8-set-default with the oracle-java9-set-default.

Using Multiple Java Versions

Users can easily have multiple Java packages installed on a single Ubuntu machine. Ubuntu Linux uses the “alternatives” system to select a default Java package between multiple packages. To find the current setting for Java, run the following command:

update-alternatives --display java

If you wish to set a fixed alternative, do it by running this command:

update-alternatives --config java

Tags: Find Java Version Ubuntu, How To Install Java on Ubuntu with Apt-Get, Install Java 7 Ubuntu, Install Java 8 Ubuntu, Install Java 9 Ubuntu, Install Java on Ubuntu with Apt-Get, Install Java on Ubuntu with PPA, Install Java Ubuntu Apt-Get, Install Java Ubuntu Firefox, Install Java Ubuntu Server, Install Java Ubuntu Terminal, Install Java Ubuntu Webupd8, Install Oracle Java 7 in Ubuntu Or Linux Mint Via PPA, Install Oracle Java 7 Ubuntu, Install Oracle Java 8 Ubuntu, Install Oracle Java 9 Ubuntu, Install Sun Java Ubuntu, Set Java Variable Ubuntu, Ubuntu Find Java Version, Ubuntu Install Java 7, Ubuntu Install Java 8, Ubuntu Install Java 9, Ubuntu Install Oracle Java 7, Ubuntu Install Oracle Java 8, Ubuntu Install Oracle Java 9, Ubuntu PPA Install Java, Ubuntu Set Java Variable

Primary Sidebar

Latest Posts

Ubuntu 25.04 ‘Plucky Puffin’ Is Available To Download

How to Login as Root User in Linux Terminal

Install Firefox In Ubuntu Terminal Command Line

How To Check Kernel Installed Date In Linux Ubuntu

How To List All Kernel Modules That Are Loaded In Ubuntu

Enable Ubuntu Auto Login Without Password

Download Ubuntu 25.04 Official Default Wallpapers

How To Fix Initramfs Error In Ubuntu Command Line

How To Check All Available Kernel Version In Linux Ubuntu

3 Best Artificial Intelligence Domain Name Generators

© 2025 Source Digit • Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap