How to install Oracle java 8 on Ubuntu 18.04

Open terminal with press Ctrl + Alt + t

:~$ sudo add-apt-repository ppa:webupd8team/java
[sudo] password for yourusername:
Oracle Java (JDK) Installer (automatically downloads and installs Oracle JDK8). There are no actual Java files in this PPA.

Important -> Why Oracle Java 7 And 6 Installers No Longer Work: http://www.webupd8.org/2017/06/why-oracle-java-7-and-6-installers-no.html

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

The PPA supports Ubuntu 18.04, 17.10, 16.04, 14.04 and 12.04.

More info (and Ubuntu installation instructions):
– for Oracle Java 8: http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html

Debian installation instructions:
– Oracle Java 8: http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html

For Oracle Java 10, see a different PPA: https://www.linuxuprising.com/2018/04/install-oracle-java-10-in-ubuntu-or.html
More info: https://launchpad.net/~webupd8team/+archive/ubuntu/java
Press [ENTER] to continue or Ctrl-c to cancel adding it.

Hit:1 http://id.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://id.archive.ubuntu.com/ubuntu bionic-updates InRelease [83,2 kB]

:~$ sudo apt-get update
[sudo] password for yourusername:
Hit:1 http://id.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://id.archive.ubuntu.com/ubuntu bionic-updates InRelease [83,2 kB]

:~$ sudo apt-get install -y oracle-java8-installer

oracle java8 installer

accept oracle binary

Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
gsfonts-x11 java-common oracle-java8-set-default
Suggested packages:
binfmt-support visualvm ttf-baekmuk | ttf-unfonts | ttf-unfonts-core ttf-kochi-gothic | ttf-sazanami-gothic ttf-kochi-mincho
| ttf-sazanami-mincho ttf-arphic-uming
The following NEW packages will be installed:
gsfonts-x11 java-common oracle-java8-installer oracle-java8-set-default

Connecting to download.oracle.com (download.oracle.com)|104.69.165.90|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 190890122 (182M) [application/x-gzip]
Saving to: ‘jdk-8u171-linux-x64.tar.gz’

#####Important########
To set Oracle JDK8 as default, install the “oracle-java8-set-default” package.
E.g.: sudo apt install oracle-java8-set-default
On Ubuntu systems, oracle-java8-set-default is most probably installed
automatically with this package.
######################

:~$ java -version
java version “1.8.0_171”
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

:~# nano /etc/environment

Add or put  JAVA_HOME and JRE_HOME

JAVA_HOME=/usr/lib/jvm/java-8-oracle
JRE_HOME=/usr/lib/jvm/java-8-oracle/jre

 

On your Ubuntu desktop click show applications , and you will found :

Java Monitoring & Management Console

Oracle Java Mission Control

Java Control Panel

Policy Tool

Java VisualVM

Java Cache Viewer

If you want to open file with extension  .jnlp  , select that file , tap anywhere on Touchpad  using 2 fingers  ,  click open with Oracle Java 8 Web Start.  Follow each  instruction guide to access your remote server , and you can  manage remotely your server  , example : reinstall with custom iso file , etc.