Scala插件Netbeans 7.3 $ SCALA_HOME

时间:2013-04-05 13:51:33

标签: scala netbeans-7

我遇到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。其次,这是我为解决这个错误所做的工作:

  1. 在netbeans.conf中添加到-J-Dscala.home=/usr/local/Cellar/scala/2.10.1/libexec/bin netbeans_default_options,我相信这是scalac二进制文件的实际路径(我使用brew安装了scala)
  2. 创建~/.MacOSX/environment.plist包含(之后重新启动):
  3. <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>'
    
    1. 已经尝试thisthis,但没有效果。
    2. 非常感谢任何帮助!!

1 个答案:

答案 0 :(得分:1)

经过广泛的谷歌搜索后,我找到了解释这一切的人: Solution