Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting environment variables for an entire project

In Eclipse, it is possible to set environment variables using "run configurations", but this works only for a specific main program.

I have many different main programs in the same project, and I want to set the same environment variables in all of them. What is the easiest way to do this?

like image 847
Erel Segal-Halevi Avatar asked Mar 11 '14 20:03

Erel Segal-Halevi


2 Answers

What I usually do for a global environment variable is usually set it at the OS level. I do not know if there is a way in Eclipse to set global environment variables.

like image 51
Christopher Z Avatar answered Sep 29 '22 19:09

Christopher Z


You can create and set variables globally in Eclipse via the String Substitution form. The form is found via Preferences->Run/Debug->String Substitution.

Variables declared in the form can be used by referencing them with ${variable_name}.

More information about string substitution can be found here

like image 43
HAL Avatar answered Sep 29 '22 18:09

HAL