Monday, March 18, 2019

javapath and JAVA_HOME

The Java SE JDK and JRE 8 installer for Windows will prepend the Windows Path environment variable with the 32-bit path:

C:\Program Files (x86)\Common Files\Oracle\Java\javapath


But the installer won't set JAVA_HOME.

This causes problems if the user wants to install another version of Java (e.g. Java 7). javapath is still there and Java 7 cannot be found there.

It also causes problems when the user tries to run javac or jar as they are not available under javapath.

After the installation of Java 8, one should manually set the JAVA_HOME environment variable pointing to the newly generated Java executables (e.g. C:\Program Files\Java\jdk1.8.0_66\bin). And prepend %JAVA_HOME%\bin to the beginning of the Windows Path environment variable.

No comments:

Get This <