On Ubuntu it is possible to have multiple JVMs at the same time. The default one is selected with update-alternatives
. But this does not set the JAVA_HOME
environment variable, due to a debian policy.
I am writing a launcher script (bash), which starts a java application. This java application needs the JAVA_HOME
environment variable. So how to get the path of the JVM which is currently selected by update-alternatives
?