Intellij 15.0.3是否支持gradle和scala?

时间:2016-01-20 00:16:22

标签: scala intellij-idea gradle

我正在使用Intellij IDEA 15.0.3 BUILD#IC-143.1821和

  • Scala插件2.1.0
  • Gradle插件143.1821.5

当我加载gradle项目时,我发现无法使用此错误运行scala应用程序:

/usr/java/jdk1.7.0_67-cloudera/bin/java -Didea.launcher.port=7535 -Didea.launcher.bin.path=/home/cloudera/apps/intellij/idea-IC-143.1184.17/bin -Dfile.encoding=UTF-8 -classpath /usr/java/jdk1.7.0_67-cloudera/jre/lib/jfxrt.jar:/usr/java/jdk1.7.0_67-cloudera/jre/lib/plugin.jar:/usr/java/jdk1.7.0_67-cloudera/jre/lib/jce.jar:/usr/java/jdk1.7.0_67-cloudera/jre/lib/deploy.jar:/usr/java/jdk1.7.0_67-cloudera/jre/lib/rt.jar:/usr/java/jdk1.7.0_67-cloudera/jre/lib/javaws.jar:/usr/java/jdk1.7.0_67-cloudera/jre/lib/charsets.jar:/usr/java/jdk1.7.0_67-cloudera/jre/lib/resources.jar:/usr/java/jdk1.7.0_67-cloudera/jre/lib/jsse.jar:/usr/java/jdk1.7.0_67-cloudera/jre/lib/management-agent.jar:/usr/java/jdk1.7.0_67-cloudera/jre/lib/jfr.jar:/usr/java/jdk1.7.0_67-cloudera/jre/lib/ext/sunjce_provider.jar:/usr/java/jdk1.7.0_67-cloudera/jre/lib/ext/zipfs.jar:/usr/java/jdk1.7.0_67-cloudera/jre/lib/ext/dnsns.jar:/usr/java/jdk1.7.0_67-cloudera/jre/lib/ext/sunpkcs11.jar:/usr/java/jdk1.7.0_67-cloudera/jre/lib/ext/sunec.jar:/usr/java/jdk1.7.0_67-cloudera/jre/lib/ext/localedata.jar:/home/cloudera/workplace/spark-streaming-test/out/production/spark-streaming-test:/home/cloudera/.m2/repository/com/github/scopt/scopt_2.10/3.3.0/scopt_2.10-3.3.0.jar:/home/cloudera/.m2/repository/com/typesafe/scala-logging/scala-logging-api_2.10/2.1.2/scala-logging-api_2.10-2.1.2.jar:/home/cloudera/.m2/repository/com/typesafe/scala-logging/scala-logging-slf4j_2.10/2.1.2/scala-logging-slf4j_2.10-2.1.2.jar:/home/cloudera/apps/intellij/idea-IC-143.1184.17/lib/idea_rt.jar com.intellij.rt.execution.application.AppMain HelloWorld
Exception in thread "main" java.lang.NoClassDefFoundError: scala/Predef$
    at HelloWorld$.main(HelloWorld.scala:7)
    at HelloWorld.main(HelloWorld.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.ClassNotFoundException: scala.Predef$
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 7 more

显然,scala库不在类路径中。

  • 在“打开模块设置”中,我可以在“项目”中找到scala库 设置 - >模块 - >依赖“。
  • 在“项目设置 - >库”中,有scala-sdk使用2.10.4。
  • “项目设置 - > Facets”
  • 中没有任何内容

IDEA似乎不支持Gradle和Scala。如果我创建一个新项目,选择Gradle,我只能使用框架Java,Groovy和Kotlin;而选择scala,只有Scala,SBT和Activator。

我是Intellij的新手。我犯了一些错误吗?

0 个答案:

没有答案