Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse environment variables

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?

like image 637
Victoria Seniuk Avatar asked Sep 19 '25 10:09

Victoria Seniuk


1 Answers

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

like image 59
Sevich Avatar answered Sep 22 '25 00:09

Sevich