Praveen Sripati Praveen Sripati - 1 year ago 123
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.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download