0
我遇到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/bin
netbeans_default_options,我相信這是scalac二進制文件的實際路徑 - 創建(我使用BREW安裝階)
~/.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>'