【发布时间】:2013-04-05 13:51:32
【问题描述】:
我遇到了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。其次,这是我为修复此错误所做的:
- 添加到netbeans.conf中的
-J-Dscala.home=/usr/local/Cellar/scala/2.10.1/libexec/binnetbeans_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>'
非常感谢任何帮助!
【问题讨论】:
标签: scala netbeans-7