Language:

Portal Home > Knowledgebase > Tech articles > [EN/LT] How to install JAVA?


[EN/LT] How to install JAVA?




For Ubuntu OS users:

Oracle Java 8
Oracle Java 9 (End Of Life)
Oracle Java 10


For Debian OS users:

Oracle Java 8
Oracle Java 9 (End Of Life)
Oracle Java 10




Ubuntu Oracle Java 8 installation

IMPORTANT: Currently supported Ubuntu versions are: 18.04 / 17.10 / 16.04 / 14.04 / 12.04

Execute the following commands:

1. apt-get update

2. add-apt-repository ppa:webupd8team/java

   Note: If you get this output "-bash: add-apt-repository: command not found" after executing command above you need additional tools to install using command below:

   apt-get install software-properties-common

   Install all offered packages and back to command execution provided on the 1st point.

3. apt-get update

4. apt-get install oracle-java8-installer

To check installed JAVA version execute the following command:

5. java -version

You should get the following or similar output on screen:

java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)







Ubuntu (64Bit) Oracle Java 9 installation (End Of Life)

IMPORTANT: Oracle Java 9 has reached end of life - http://www.oracle.com/technetwork/java/javase/downloads/jdk9-downloads-3848520.html

Execute the following commands:

1. apt-get update

2. add-apt-repository ppa:webupd8team/java

   Note: If you get this output "-bash: add-apt-repository: command not found" after executing command above you need additional tools to install using command below:

   apt-get install software-properties-common

   Install all offered packages and back to command execution provided on the 1st point.

3. apt-get update

4. apt-get install oracle-java9-installer

To check installed JAVA version execute the following command:

5. java -version

You should get the following or similar output on screen:

java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)





Debian Oracle Java 8 installation

Execute the following commands:

1. apt-get update

2. echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee /etc/apt/sources.list.d/webupd8team-java.list

3. echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list

4. apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886

5. apt-get update

6. apt-get install oracle-java8-installer

To check installed JAVA version execute the following command:

7. java -version

You should get the following or similar output on screen:

java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)







Debian Oracle Java 9 installation (End Of Life)

IMPORTANT: Oracle Java 9 has reached end of life - http://www.oracle.com/technetwork/java/javase/downloads/jdk9-downloads-3848520.html

Execute the following commands:

1. apt-get update

2. echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee /etc/apt/sources.list.d/webupd8team-java.list


3. echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list

4. apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886

5. apt-get update

6. apt-get install oracle-java9-installer

To check installed JAVA version execute the following command:

7. java -version

You should get the following or similar output on screen:

java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)




Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read

Powered by WHMCompleteSolution