Everybody knows that the java executable is located in /usr/bin/java , but what if you need the JDK / JRE location itself?
Just using “whereis” will not get you there, that will point you to the /usr/bin/java point.
So, let’s find out a but more about /usr/bin/java:
ls -l /usr/bin |grep java
ls -l /etc/alternatives/ |grep java
Which means the JRE location is: