Set Environment Variable At Eclipse workspace level for all launchers?

后端 未结 2 1517
花落未央
花落未央 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:12

    I have a different approach for doing this on windows. This solution allows you to store a large number of environment variables to one place and apply them globally inside eclipse.

    1. I have gitBash installed already, and associated in windows to execute .bash files
    2. I set up a /c/Temp/.env file with lots of environment variables in the format

    export VARIABLE=my value

    1. I create an eclipse_startup.bash script that looks like this (and pin it to my start menu).
    echo setting up env
    . /c/Temp/.env
    
    echo starting eclipse
    /c/Users/me/eclipse-oxygen/eclipse/eclipse.exe
    

    It has the disadvantage that I end up with a bash window open with eclipse, and I have to restart after changing the environment. On the plus side, my complex application has lengthy environment files already, so I can simply load them in and start.

提交回复
热议问题