开发者

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

开发者 https://www.devze.com 2023-03-19 14:17 出处:网络
In .bash_profile I have listed many env variables as follows: export JAVA_HOME=... export PYTHON=... ...

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

精彩评论

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