Ubuntu Linux Install Sun Java Development Kit ( JDK ) and Java Runtime Environment ( JRE )

Ubuntu Linux Install Sun Java Development Kit ( JDK ) and Java Runtime Environment ( JRE )

To install the Sun Java Development Kit (JDK) and Java Runtime Environment (JRE) on Ubuntu Linux, follow these steps:

  1. Add the Oracle Java PPA to your system's package sources by typing the following command:
sudo add-apt-repository ppa:webupd8team/java
‮ruoS‬ce:www.lautturi.com
  1. Update the package index by typing the following command:
sudo apt-get update
  1. Install the Oracle JDK by typing the following command:
sudo apt-get install oracle-java8-installer

This will install both the JDK and the JRE.

  1. To set Oracle Java 8 as the default Java version, type the following command:
sudo apt-get install oracle-java8-set-default
  1. To verify the installation, type the following command:
java -version

This will display the version of Java installed on your system.

Note: The Oracle JDK is no longer available for download from Oracle's website. If you want to install a different version of the JDK, you can try downloading it from a third-party website or use the OpenJDK, which is available in the default Ubuntu package repositories. To install the OpenJDK, type the following command:

sudo apt-get install openjdk-8-jdk
Created Time:2017-10-30 14:27:25  Author:lautturi