2024年5月21日发(作者:卞清昶)
苹果下的环境变量配置-电脑资料
mac os x 10.7.4 以前可以使用 来控制全局的环
境变量.
但到了 Lion 以后,这个方式被废除了. 同时 修改配置文件的一些方
式,也最多会影响到终端的环境变量了..
On Mountain Lion all the /etc/paths and /etc/
editing doesn't take any effect!
Apple's Developer Forums say:
"Change the of the .app itself to contain an
"LSEnvironment" dictionary with the environment variables you
want.
~/.MacOSX/ is no longer supported."
那么如何配置.app的环境变量呢?
最开始我使用了比较trick的方式
从终端运行app.然后app继承了终端的环境变量...
慢慢在英文的世界中,找到如下方案.
Change the of the .app itself to contain an
"LSEnvironment" dictionary with the environment variables you
want.
There will be an per application in
/Content/.
You can edit it.
Click the "+" on the Information Property List and add a
dictionary called LSEnvironment.
If you type it correctly it will rename it to Environment
variables. And It changed to a dictionary.
Then you click the "+" by that for each environment variable
you want to add under this dirctionary.
QTDIR /Users/...
关闭应用程序,重启生效...
最关键的一步:你需要使你刚才的改动刷新到系统里面去.
you need to force update the LaunchService database in the
Terminal by using the lsregister command:
使用如下命令.
/System/Library/Frameworks/ork/Fram
eworks/ork/Support/lsregister
/Applications/eclipse/
-v -f
2024年5月21日发(作者:卞清昶)
苹果下的环境变量配置-电脑资料
mac os x 10.7.4 以前可以使用 来控制全局的环
境变量.
但到了 Lion 以后,这个方式被废除了. 同时 修改配置文件的一些方
式,也最多会影响到终端的环境变量了..
On Mountain Lion all the /etc/paths and /etc/
editing doesn't take any effect!
Apple's Developer Forums say:
"Change the of the .app itself to contain an
"LSEnvironment" dictionary with the environment variables you
want.
~/.MacOSX/ is no longer supported."
那么如何配置.app的环境变量呢?
最开始我使用了比较trick的方式
从终端运行app.然后app继承了终端的环境变量...
慢慢在英文的世界中,找到如下方案.
Change the of the .app itself to contain an
"LSEnvironment" dictionary with the environment variables you
want.
There will be an per application in
/Content/.
You can edit it.
Click the "+" on the Information Property List and add a
dictionary called LSEnvironment.
If you type it correctly it will rename it to Environment
variables. And It changed to a dictionary.
Then you click the "+" by that for each environment variable
you want to add under this dirctionary.
QTDIR /Users/...
关闭应用程序,重启生效...
最关键的一步:你需要使你刚才的改动刷新到系统里面去.
you need to force update the LaunchService database in the
Terminal by using the lsregister command:
使用如下命令.
/System/Library/Frameworks/ork/Fram
eworks/ork/Support/lsregister
/Applications/eclipse/
-v -f