Praveen Sripati Praveen Sripati - 5 months ago 48
Java Question

Environment variables in Eclipse

I am able to run a sample hadoop program from the command prompt and am trying to run the same program from Eclipse, so that I can debug it and understand it better.

For the command line program, some environment variables are set in the

and the same are being read as
in the hadoop program. But, when I am running a java program with
, from Eclipse I am getting null.

I tried passing
to VM parameters in the runtime configurations from Eclipse, but still getting null in the standalone program. How to make the environment variables visible within Eclipse? When I iterate through
in Eclipse, I see lot of variables like
and others. Where are they set? I am using Ubuntu 11.04.


The .bashrc file is used for setting variables used by interactive login shells. If you want those environment variables available in Eclipse you need to put them in /etc/environment.