Why do you need JAVA_HOME environment variable?
JAVA_HOME is defined as the environment variable explicitly by the systems engineers majorly for the below reasons. Note that java.home is always there inside JVM, whereas JAVA_HOME exists mainly in your shell environment and you may pass it to JVM as a system property. First and foremost reason is to ensure that your Java programs pick the right Java.exe. On Systems (Windows/Linux/Solaris), java.exe is duplicated in several places, for instance %JAVA_HOME%binjava.exe, $JAVA_HOMEjrebinjava.exe, and %SystemRoot%system32java.exe. Without having $JAVA_HOME/bin at the beginning of the PATH, a java command will always resolve to %SystemRoot%system32java.exe, which may not be what you want. When you […]
Read more