I have inserted the following lines in .bash_profile
export GOOGLE_APPLICATION_CREDENTIALS=/Users/jun/Downloads
export PATH=$PATH:GOOGLE_APPLICATION_CREDENTIALS
and the changes did take effect
However, when I try to access the environment variable with the following method
System.out.println(System.getenv("GOOGLE_APPLICATION_CREDENTIALS"));
The result is NULL
Why is that?
Note: The application is ran with Eclipse.

PATHin your.bash_profile(and setting it to a literal string because you missed out a$beforeGOOGLE) but then you're trying to readGOOGLE_APPLICATION_CREDENTIALSin yourechocommand and your app. However if theechocommand is working, I would expect your app code to also work, if it's being run in the same environment.java -cp <CLASS_APTH> YOUR_MAIN_CLASS.