If you are running Linux, you can investigate the command alternativesif your distribution uses it. Alternatives to java (I think available by typing alternatives javabut check the man page for details) will list all installed JREs and indicate which one is the current system default value. It also makes it easy to switch between different versions.
source
share