There are two kinds of java, oracle java JDK and open JDK, you can install both on ubuntu, but only one will be active JDK at one time. This article is about installing oracle java development kit (JDK) on ubuntu.
Step by step how to install Oracle JDK on Ubuntu
- add PPA repo for oracle JDK
- run update command
- install the JDK itself
- add java home variable