Set Environment Variable At Eclipse workspace level for all launchers?

后端 未结 2 1483
花落未央
花落未央 2021-02-20 03:38

Can I set a workspace wide setting to add an environment variable to all future launchers created in the workspace?

Use Case

  • Our unit test
2条回答
  •  终归单人心
    2021-02-20 04:03

    Only option which I can think of is similar to yours where you can create multiple shell scripts(linux) or batch files(windows) and set it up there. for ex -

    I am giving examples for windows environment and same can be done for Linux as well -

    for windows-

    eclipse.exe -DvariableName1=value1 -DvariableName2=value2
    

    As you want to pass different variables to different workspaces, you can also pass location of your workspace as part of arguments.

    eclipse.exe -data  -DvariableName1=value1 -DvariableName2=value2
    

    You can create multiple shortcuts of eclipse.exe in windows and place them on Desktop (for quick access) if needed. Each shortcut may point to a similar variant of above command with different workspace and different variables.

    Hope this helps. Happy coding :)

提交回复
热议问题