开发者

How to use environment variables in Java with Eclipse? (MAC OS X)

In .bash_profile I have listed many env variables as follows:

export JAVA_HOME=...
export PYTHON=... 
...

System.getenv() returns a list of env variables (e.g., SHELL, TMP_DIR) but not t开发者_StackOverflow中文版hose listed in .bash_profile. Where these are coming from and how to get the ones in .bash_profile?

Thanks!


Eclipse takes them from the run configuration. menu Run->Run Configurations...

Select your app, switch to the arguments tab, and put your env variables down there, eg:

-Dname=value


You probably want them in .bashrc instead of .bash_profile. See the INVOCATION section of the bash man page for details of how and when certain init files are loaded.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜