Why doesn't the Java SDK installer set JAVA_HOME?

后端 未结 6 489
南笙
南笙 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 don't think JAVA_HOME is a convention invented or supported by Sun.

    They probably remember the fiasco that was the CLASSPATH environment variable** all too well and prefer to stay the hell away from environment variables.

    ** This was encouraged as the primary way to set the JVM classpath in earlier Java SDKs and literature, and resulted in the user and various applications messing with the environment variable, overwriting each other's changes and depending on mutually contradictive contents.

提交回复
热议问题