In Ubuntu I have exported the below environment variable in ~/.bashrc:
export MY_VAR="MY_VAR_VALUE"
When I re-open a terminal I can do:
~ $ echo $MY_VAR
MY_VAR_VALUE
~ $
But when I do this in Java/Eclipse (which I have restarted after exporting the test env. var):
String myVar = System.getenv("MY_VAR");
System.out.println(myVar);
I just get null. Does eclipse not see variables set in ~/.bashrc ?