Launch mac eclipse with environment variables set

后端 未结 8 1594
隐瞒了意图╮
隐瞒了意图╮ 2020-11-29 00:16

My company provides an eclipse based development environment which needs some environment variables setting up for the underlying toolchain so multiple versions can be insta

8条回答
  •  孤独总比滥情好
    2020-11-29 00:34

    This worked perfectly in OS X Yosemite:

    1. Open /Applications/Automator.
    2. When the drop-down appears asking you what kind of document you want to create, choose "Application."
    3. In the second-from-the-left list, double-click "Run Shell Script."
    4. In the right side delete the "cat" that gets put there automatically, and replace it with this:

      source ~/.bash_profile && /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse
      

    Now go to File->Save, and save the application to your Applications directory. I named it "Eclipse" with a capital 'E' so as not to conflict with the "eclipse" directory I already had. For good measure, you can even give it the Eclipse icon by selecting the real eclipse app, pressing command-i, selecting the icon, pressing command-c, then selecting the automator "Eclipse" app, pressing command-i, selecting the icon, and pressing command-v.

    Now you can open the app, or even drag it to your dock. Note that if you start it, the "real" eclipse will still show up in your dock as a separate icon, but you can't have everything. :)

提交回复
热议问题