我可以使用karma命令行和maven命令行在Karma中运行我的Jasmin测试,但是当尝试从STS 3.2.0.RELEASE(Eclipse Juno 4.2)中运行maven(例如.mvn install)时,我得到了以下错误:
Failed to execute goal com.kelveden:maven-karma-plugin:1.2:start (default) on project store-webapp: There was an error executing Karma. Cannot run program "karma": error=2, No such file or directory -> [Help 1]
就像Eclipse shell maven一样,它在路径中没有/ usr / local / bin。有没有办法配置eclipse在调用maven时使用的路径?
我的环境是:
让
答案 0 :(得分:1)
它出现在Mac OS X 10.8中(可能更早),GUI应用程序与终端没有相同的路径。要将/ usr / local / bin添加到全局路径,您需要编辑(并可能创建)/etc/launchd.conf
以包含setenv PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
您必须使用admin privs编辑/创建此文件,因此请使用带有vi的su或nano sudo nano /etc/launchd.conf
在此更改生效之前,您需要重新启动Mac。此信息可在ServerFault上找到https://serverfault.com/questions/16355/how-to-set-global-path-on-os-x/277034#277034