Why doesn't the Java SDK installer set JAVA_HOME?

后端 未结 6 499
南笙
南笙 2020-12-05 13:26

I always wondered why I have to manually set the JAVA_HOME environment variable after installing the Java SDK.

JAVA_HOME=c:\\Program Files\\Java\\jdk1

6条回答
  •  半阙折子戏
    2020-12-05 13:31

    I'm not sure why this is, because the installers clearly solve platform dependant issues (which is ofcourse the whole point of a JVM). Are you sure you aren't mixing the JRE with the JSDK?

    Maybe there's a way for your program to search where java is installed (that would be a script I guess), and then set JAVA_HOME and possibly add it to the path.

    IBM seems to be doing this trick already: http://www-01.ibm.com/support/docview.wss?rs=180&uid=swg21199220

    Other interesting post hinting at the difference between JRE and JSDK installations: http://confluence.atlassian.com/display/CONF26/Set+JAVA_HOME+variable+in+Windows

    Hope this helps.

提交回复
热议问题