Java is very popular programming language between open source community. Java is used for a lot of opensource projects. To run java applications it Java Run time Environment or Java Development Kit should be installed. We can check specific version java like below.
-bash: java: command not found
Oh there is a problem. java command cannot be found which means it is not installed or the path is not specified. In this case it is not installed in our system. So we will install open-jre like below.
$yum install java-1.8.0-openjdk-headless.x86_64 -y
Ubuntu, Debian, Kali
$apt-get install openjdk-9-jre -y
Now we check the version again.
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-b15)
OpenJDK 64-Bit Server VM (build 25.111-b15, mixed mode)
As we see we installed Open-jre which is open source java implementation. Other alternative is Oracle jre which is closed source. We can see that our version is 1.8.0_111