Finding the right path for JAVA_HOME bit complicated on Ubuntu , as it uses alternatives. On my machine, this is how alternatives create at least two levels of indirection before they get into actual java or javac.
usr/bin/javac -> /etc/alternatives/ /etc/alternatives/java -> /usr/lib/jvm/jdk1.7/bin/javac
If I set JAVA_HOME to /usr/lib/jvm/jdk1.7 , it is possible that my system java may become incompatible with the java that JAVA_HOME points to if I update alternatives to use another java.
My question is: what is the correct value for JAVA_HOME on a system using alternatives. I tend to think JAVA_HOME should be installed on /usr
This TOMCAT method or any other software that uses it will add βbinβ to JAVA_HOME and find all the executables it needs.
This is the correct value for JAVA_HOME for alternate systems. Do you use most JAVA_HOME software only to search for executable files, or will they use the value to search for other artifacts (such as a security policy file, etc.) that come with the JDK? If the former is true, then I feel that we can use /usr for JAVA_HOME , but if the latter is true, then I believe that the only way to use JAVA_HOME correctly is to sacrifice alternative functionality.
Parag
source share