Install Java on Ubuntu (JDK / JRE)

By default, the Ubuntu operating system does not embed Java software. So much the better because its versions are quickly obsolete due to patches that fill in security vulnerabilities constantly discovered. If Java is no longer essential for daily browsing on the Internet, some web or business applications require the use of the client runtime (JRE) or even the Development kit (JDK). Two solutions are possible for install Java on Linux version Ubuntu / Debian : OpenJDK (Java open source version) or Oracle proprietary version JRE / JDK. Everything is done by command line in a simple terminal.

Is Java already installed?

1. Update the system: apt-get update

2. Check if Java is not already installed: java -version

If a return is displayed, the client (JRE) or server (JDK) software is present on Ubuntu in the version indicated.

Install OpenJDK (Java open source)

1. Command to install the openjdk client (therefore only the JRE) in the latest version 8:

sudo apt-get install openjdk-8-jre

If you need to install version 7, ask: sudo apt-get install openjdk-7-jre

tutorial install java openjdk linux ubuntu debian

2. Check the installation:

java -version

The return should be similar to this:

openjdk version “1.8.0_111”
OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2ubuntu0.16.04.2-b14)
OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)

tutorial install java openjdk linux ubuntu debian

Install Oracle Java

1. Add the official Java Oracle repo:

sudo apt-add-repository ppa: webupd8team / java

2. Request a refresh of the available packages:

sudo apt-get update

3. Install Java Oracle version:

sudo apt-get install oracle-java8-installer

4. Modify JAVA_HOME, example with the default installation path:

export JAVA_HOME = / usr / lib / jvm / java-8-oracle

5. Check the correct installation of the software:

java -version

which should return something like:

java version “1.8.0_92”
Java (TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot (TM) 64-Bit Server VM (build 25.92-b14, mixed mode)

java oracle version ubuntu

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button

Adblock Detected

Please consider supporting us by disabling your ad blocker