Making sure JAVA_HOME is correctly set

前端 未结 6 574
北荒
北荒 2020-12-12 22:49

Pretty new to Java and also to Mac ... I want to make sure JAVA_HOME is set so in other programs I can use its path. So I did some Googling and here is what I got:

I

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-12 23:00

    This is not resilient to new installs of the JDK. According to Apple: - you should not set it globally - you should use libexec

    http://lists.apple.com/archives/java-dev/2011/May/msg00040.html

    You might think that:

    $ cat /etc/launchd.conf setenv JAVA_HOME /usr/libexec/java_home

    would work - but no, it sets it literally.

    But, as I say, according to that Apple Engineer, you are not supposed to set it globally anyway. :(

提交回复
热议问题