Java is one of the world’s most important and widely used computer language. It is an object-oriented language and it is very easy to learn. It is used for the system software development, web application and Android Applications.
Now if you are interested in these fields then you should know how to install the Java Development Kit (JDK) in Ubuntu. Here in this article, we will learn How to Install Java 12 in Ubuntu 18.04 LTS.
Also Read: How to Install Eclipse IDE on Ubuntu
How to Install Java 12 in Ubuntu 18.04 LTS
To install Java 12 in Ubuntu 18.04 LTS, we are going to use the terminal and few simple commands.
Just follow these steps to install Java JDK properly:
Step 1: Open the terminal as the sudo user.
Step 2: You need to add the following PPA to your Ubuntu system. This PPA contains a package oracle-java12-installer file
Note:- We are going to install Oracle Java.
sudo add-apt-repository ppa:linuxuprising/java
After adding the PPA, enter you password to continue.
Note:- Press Enter keywhen you see this message “Press [ENTER] to continue or Ctrl+c to cancel adding it”.
Step 3: After that use this line of command.
sudo apt-get update
Step 4: Now to install Oracle Java JDK 12 use this command.
sudo apt install oracle-java12-installer
To continue the installation just Press Y Key. Configure the “Oracle Technology Network Licences Agreement for Oracle Java SE“
Note:- Use navigation Key to select the option.
Step 5: After the installation process complete, now it’s time to configure Java 12 as default Java version. To set Java as default use this command
sudo apt install oracle-java12-set-default
Step 6: Use java –version to check the Java version and javac for Java compiler.
You have successfully installed Java 12 on Ubuntu 18.04 LTS operating system.