开发者

Eclipse environment variables

开发者 https://www.devze.com 2023-01-28 04:43 出处:网络
I use Eclipse.开发者_如何学Go I set for my project some environment variables. Can I get it from my java code with System.getProperty(\"SOME_VAR\") ?

I use Eclipse.开发者_如何学Go I set for my project some environment variables. Can I get it from my java code with System.getProperty("SOME_VAR") ?

How can I get the environment variables from java code in Eclipse?


System.getProperty(String propertyName) - this method is used for getting properties and not for the environment variables.

To get environment variable you can use System.getenv(String envName) method.

First link in google leads to this http://blog.codebeach.com/2008/02/get-environment-variables-in-java.html

0

精彩评论

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