Java is a broadly useful programming language that is class-based, object-arranged, and intended to have as hardly any execution conditions as could be expected under the circumstances.
In this post, We will Install Java on ubuntu 16.04 | 18.04 | 20.04
Before we continue seeing the procedure to introduce Java, we should rapidly comprehend the distinction between JRE, OpenJDK and Oracle JDK.
- JRE (Java Runtime Environment) is the thing that you would require typically to run a Java-based application. This is all you need on the off chance that you are not a software engineer.
- JDK (Java Development Kit) is the thing that you have to in the event that you need to do some do some programming or create programming identified with Java.
- OpenJDK is Open Source execution of Java Development Kit while Oracle JDK is the official Oracle variant of Java Development Kit. While OpenJDK is adequate for a large portion of the cases, a few projects such Android Studio proposes utilizing Oracle JDK to maintain a strategic distance from UI/execution issue.
To install JAVA JRE use the following command.
$ sudo apt-get default-jre -y
Use the following command to install JAVA JDK.
$ sudo apt install default-jdk -y
Install Oracle JDK
To install the packages use the following command.
$ sudo add-apt-repository ppa:webupd8team/java -y
$ sudo apt-get update
$ sudo apt install oracle-java8-installer
$ sudo apt install oracle-java8-set-default
Verify Java Version
$ java –version
How to Install Java on ubuntu 16.04 | 18.04 | 20.04