Eclipse Environment Variables

I am using Eclipse. I set some environment variables for my project. Can I get it from my java code using System.getProperty("SOME_VAR")?

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

+3
source share
1 answer

System.getProperty (String propertyName) - This method is used to get properties, not environment variables.

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

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

+6

Source: https://habr.com/ru/post/1778098/


All Articles