Home / Computer / 2 How to Install Java on Ubuntu Linux for Beginners (Complete + Image)

2 How to Install Java on Ubuntu Linux for Beginners (Complete + Image)

Java and Java's Virtual Machine (JVM) has been widely used for many needs software . Java is a platform that can run applications (Java based) on specific operating systems by interpreting a number of bytecodes . Not only required by a developer or programmer Java is also required for ordinary users to run various Java-based applications contained on their computers, by utilizing Java Runtime .

How to Install Java on Linux Ubuntu

There are different ways of installing Java on some platforms . Unlike Windows, how to install Java on Ubuntu is usually done through the terminal. Before installing Java, it's a good idea to check if your Ubuntu is already installed Java or not. If you have, at least you can find out which version is installed on your Ubuntu. If possible you would like to reinstall for the latest version of Java. There are two ways to install java on Ubuntu Linux, ie installation according to defaults and specific installs.

# 1 How to Install Java Default

For the default install you can follow the steps below.

1. Open a terminal on your Ubuntu. Perform update to update your Ubuntu to up-to-date, with the command:

sudo apt-get update

 how to install java on linux
2. Then, do the following command to install JDK:

sudo apt-get install default-jdk

Type Y to continue if there is a question as pointed by the arrow in the image below. [19659006]

how to install java on linux ubuntu ” width=”670″ height=”432″ />
and the command below to install JRE

sudo apt-get install default-jre

 install default jre
Need to know, if You have installed JDK commands, then you no longer need to run the command to install JRE . Because, in JDK there is a JRE.

The JDK (Java Development Kit) is a Java installer package usually required by programmer by exploiting compiler contained therein to run bytecode from the program. In JDK there is also Java Runtime to run the application. Unlike the JRE (Java Runtime Environment) that can only be used to run Java-based applications. JRE does not exist compiler which can run bytecode when you write a program.

# 2 How to Install Java Specificly

There are two ways to install Java specifically, command openjdk and oracle . This specific installation aims to install the desired Java version as needed. For example, an Ubuntu user requires Java 7 to be installed on the system, then the user can directly use the openjdk-7-

Similarly, if you want to install oracle Java 8 the command used is specific. The steps of installing the above two ways are not much different. There are only the differences in the order.

The following steps to install Java openjdk .

Actually, Java type openjdk and default are the same. Openjdk is a Java type default which is used to install Java specifically as per the user's requirements.

1. Type the update command on the terminal to make sure your Ubuntu is up-to-date.

sudo apt-get update

 sudo apt update
2. Then type the command for the Java installation. For example, you want to install Java 8. Then the command looks like the following:

sudo apt-get install openjdk-8-jdk

 install openjdk-jdk
or if you want to install Java SE Runtime Environment:

sudo apt-get install openjdk-8-jre

 how to install java on linux for beginners
If you want to install a different Java version, you just replace the number 8 in the command according to the version number you want

3. Wait for the installation process to complete.

Steps to install Java oracle .

1. Before installing Java oracle you must add the Oracle PPA to your repository. Type the command below:

sudo add-apt-repository ppa: webupd8team / java

 install ppa oracle

2. After that, do update with the command:

sudo apt-get update

 sudo apt update

3. Next, you can type the installation command for the Java version you want. Same as openjdk, You just need to replace the Java version number oracle the following command with the version number you want. Here I am installing Java oracle 8.

sudo apt-get install oracle-java8-installer

 install oracle java

4. Wait for the installation to complete. If there is a configuration request like the image below, select OK by pressing Enter .

 select OK with enter

5. Navigate to the Yes option, then press Enter on keyboard .

 select Yes with enter in Yes
6. Wait for installation to complete.

How to install Java on Ubuntu. You can check the results of your installs by typing the command:

java -version

 check java version

From the results of the command you will know which java version is installed on your Ubuntu. The java version usually begins with the number 1. and then proceed with the version (in number) Java successfully installed. If you have other questions or comments about some how to install java in Linux above, please input in the comment field below. Thank you.

Loading...

Check Also

Here's how to watch Youtube videos directly from VLC

Youtube is one of the most popular media for many people. The reason is, most …