2 wanzi0128 wanzi0128 于 2014.09.13 15:28 提问

使用gradle编译打包scala工程,报错:

1.使用的版本
jdk1.7.004
gradle 2.1
scala 2.11.2

2.代码结构
src/main/scala/HelloWorld.scala

package 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:\Workfiles\Scala\gradleproject>gradle build -stacktrace
:compileJava UP-TO-DATE
:compileScala FAILED

FAILURE: 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 more

BUILD FAILED

Total time: 12.063 secs

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!