If you need to install java on your system, you can't go wrong by choosing oracle JDK instead of open JDK, because some people said that oracle JDK is more reliable because it's maintain by company that create java itself.
So there are two choices of java that you can have on xubuntu and ubuntu in general, the open source open JDK and the proprietary oracle JDK. JDK stands for Java Development Kit by the way, in case you didn't know.
Step by step how to install oracle JDK on Xubuntu (i'm using 16.04)
- add PPA repo for oracle JDK
- run update command
- install and run the oracle JDK installer version 8
- make sure the JAVA_HOME variable pointing in the right direction
- done!
sudo apt-add-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
That's it now you have java on your system and ready to use, note that by the time i wrote this tutorial java 9 is also available to install, but it's still in beta version, so it's not recommended to install, better stick with java version 8.
Alternatively, older version of java can be install as well, such as java 6 and 7, if you wish to install those the package name is 'oracle-java6-installer' for java 6 and 'oracle-java7-installer' for java 7, although i strongly suggest java 8 as i shown in this tutorial.
Alternatively, older version of java can be install as well, such as java 6 and 7, if you wish to install those the package name is 'oracle-java6-installer' for java 6 and 'oracle-java7-installer' for java 7, although i strongly suggest java 8 as i shown in this tutorial.