I use Eclipse. 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: Get Environment Variables in Java
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With