我遇到Netbeans Scala plugin的问题。运行我的项目时出现以下错误:
> ant -f /Volumes/Z/Users/vincent/Dropbox/Programming/Scala/U4Handler run Could not load definitions from resource scala/tools/ant/antlib.xml. It could not be found. init: deps-jar:
> /Volumes/Z/Users/vincent/Dropbox/Programming/Scala/U4Handler/nbproject/build-impl.xml:405:
> The following error occurred while executing this line:
> /Volumes/Z/Users/vincent/Dropbox/Programming/Scala/U4Handler/nbproject/build-impl.xml:238:
> Problem: failed to create task or type scalac Cause: The name is undefined. Action: Check the spelling. Action: Check that any custom tasks/types have been declared. Action: Check that any <presetdef>/<macrodef> declarations have taken place.
> BUILD FAILED (total time: 0 seconds)
首先,我不知道它为什么运行参数ant -f
,我不在这个项目中使用Ant。其次,这是我为解决这个错误所做的工作:
-J-Dscala.home=/usr/local/Cellar/scala/2.10.1/libexec/bin
netbeans_default_options,我相信这是scalac二进制文件的实际路径(我使用brew安装了scala)~/.MacOSX/environment.plist
包含(之后重新启动):<plist version="1.0"> <dict> <key>SCALA_HOME</key> <string>/usr/local/Cellar/scala/2.10.1/libexec/bin</string> <key>PATH</key> <string>/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/Cellar/scala/2.10.1/libexec/bin</string> </dict> </plist>'