I've got 3 working solutions right now,
1) So far, my best solution is to launch Eclipse using an alternate application launcher you can easily create using Apple Script.
Create an Apple Script like by Running "Script Editor", clicking "New Document", and supplying the following:
tell application "Terminal"
do script "open -a Eclipse.app; exit"
delay 5
quit
end tell
Export that as an application, by
- choosing "File | Export"
- choose "File Format" as "Application"
- Click "Save", and call it whatever you like. I called mine
EclipseLauncher.app
, and I saved it under Applications
Run that instead of Eclipse.app
.
Note: If you have Eclipse running, you have to shut it down before trying this out.
2) Start Eclipse from the terminal - it will pick up the system PATH
defined there, and find npm when I try and run an ant task.
$ open /Applications/Eclipse.app
3) Change how Eclipse launches the ant task:
- Right click on the ant task in the
Ant view
in Eclipse.
- Choose "Run As | Ant Build ..."
- Go to the "Environment" tab
- Click "Select..." and then find the "PATH" variable and add it by clicking it's checkbox, then OK.
- Edit the "Value" for your PATH variable to include the path to
npm
, e.g. /usr/bin/:/usr/local/bin
, or if you're on Windows, probably add this to your PATH, C:\Program Files\nodejs
. Windows users may be able to solve this globally by ensuring npm is in your system Windows path
Note that you can find the path to npm in your terminal by running the following:
$ dirname $(which npm)