在Netbeans中编译Hello World程序时出现以下错误。
C:\Users\Norman\Documents\NetBeansProjects\LambdaCollectionExamples\ScalaApplication2\nbproject\build-impl.xml:238: bad option: '-make:transitive'.
这是xml文件: -
<scalac addparams="-make:transitive -dependencyfile "${basedir}/${build.dir}/.scala_dependencies" @{addparams}"
deprecation="${scalac.deprecation}"
destdir="@{destdir}"
encoding="${source.encoding}" excludes="@{excludes}"
extdirs="@{extdirs}"
force="yes"
fork="true"
includes="@{includes}"
sourcepath="@{sourcepath}"
srcdir="@{srcdir}"
target="jvm-${javac.target}"
unchecked="${scalac.unchecked}">
这是程序
package scalaapplication2
object Main {
/**
* @param args the command line arguments
*/
def main(args: Array[String]): Unit = {
println("Hello, world!")
}
}
答案 0 :(得分:0)
Scala 2.11.2给了我这样的错误。下载系统的Scala 2.10.4二进制文件应该解决它。
ant -f C:\\Users\\wayne\\Documents\\NetBeansProjects\\ScalaApplication2 run
init:
deps-jar:
Compiling 1 source file to C:\Users\wayne\Documents\NetBeansProjects\ScalaApplication2\build\classes
Recompiling 1 files
warning: there were 1 deprecation warning(s); re-run with -deprecation for details
one warning found
compile:
run:
Hello, world!
BUILD SUCCESSFUL (total time: 3 seconds)