Time for action – checking the presence of Java on Ubuntu
We will check JRE/JDK installation from the command line.
Log in to your server and run this command:
~ $ sudo update-alternatives --config java
If there is no Java properly configured you should see an output like the following:
update-alternatives: error: no alternatives for java.
In case there is one or more Java installed the output will be similar to:
There is only one alternative in link group java: /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java Nothing to configure.
Or:
There are 2 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ———————————————————— * 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode 1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode 2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode Press enter to keep the current choice[*], or type selection number:
What just happened?
We determined if a Java installation is already present on our machine. This...