To install Java go to the download center of Oracle. If you want to develop for Java you need to install the JDK, otherwise you just have to install the JRE. I recommend to install it to
/opt/java as root.
You can use
galternatives (see here) to tell your system that there’s a JRE or a compiler. Point
javac to the binaries of your installation, e.g. in