我正在使用Intellij IDEA 15.0.3 BUILD#IC-143.1821和
当我加载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库不在类路径中。
IDEA似乎不支持Gradle和Scala。如果我创建一个新项目,选择Gradle,我只能使用框架Java,Groovy和Kotlin;而选择scala,只有Scala,SBT和Activator。
我是Intellij的新手。我犯了一些错误吗?