tags:

views:

46

answers:

1

for each project, i able to set environment when i select "run it as" . can i set global environment that all project will inherit when run?

A: 

You can set environment variables in a script that starts Eclipse. These should be inherited by all child processes.

[EDIT] Create a small script which contains this:

export JAVA_HOME=....
....path-to-eclipse.../eclipse.exe

Not sure about the ".exe" on Mac. Just put the absolute path of the eclipse executable in the line below the export and it should work. To make the script executable, use chmod +x scriptname

Aaron Digulla
can you provide more detail.
cometta
whether on Linux, MacOSX, or Windows, you can start eclipse from a script or batch file. Inside that script or batch file, prior to launching eclipse, you can set environment variables that will be inherited by the eclipse process. These values will then be the defaults for every process run from eclipse that looks at environment variables.
GregS
i on MacOS, the point is, i already preset JAVA_HOME in .bash_profile and i able to use it in console. but will eclipse cannot detect it and asking me set it?
cometta
.bash_profile is only executed for new terminal windows, not for every process you start. See my edits.
Aaron Digulla