问题描述
- 使用gradle编译打包scala工程,报错:
- 1.使用的版本
jdk1.7.004
gradle 2.1
scala 2.11.22.代码结构
src/main/scala/HelloWorld.scalapackage main.scala
object HelloWorld {
def main(args: Array[String]): Unit = {
println(""hello world"")
}
}3.build.gradle文件
apply plugin: 'scala'repositories {
maven { url ""http://10.177.60.141:8888/nexus/conte..."" }
}dependencies {
compile 'org.scala-lang:scala-library:2.11.2'
compile 'org.scala-lang:scala-compiler:2.11.2'
}4.执行gradle build命令,结果:
D:WorkfilesScalagradleproject>gradle build -stacktrace
:compileJava UP-TO-DATE
:compileScala FAILEDFAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':compileScala'.scala/runtime/Nothing$
- Try:
Run with --info or --debug option to get more log output. - Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compile
Scala'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex
ecuteActions(ExecuteActionsTaskExecuter.java:69)
...........................................................
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex
ecuteActions(ExecuteActionsTaskExecuter.java:61)
... 44 more
Caused by: java.lang.ClassNotFoundException: scala.runtime.Nothing$
... 76 moreBUILD FAILED
Total time: 12.063 secs
- What went wrong:
时间: 2024-10-11 22:26:03