如何在我的类路径中使用 scala-compiler-2.8.0.jar 和 scala-library-2.8.0.jar 出现此异常?
Exception in thread "main" java.lang.NoClassDefFoundError: scala/Serializable
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at kafka.utils.ZKConfig.<init>(ZkUtils.scala:302)
at kafka.producer.ProducerConfig.<init>(ProducerConfig.scala:25)
at pt.sapo.labs.crawl.twitter.streaming.adapter.MessageBrokerStatusAdapter.<init>(MessageBrokerStatusAdapter.java:30)
at pt.sapo.labs.TwitterStreamClientApplication.createAdapters(TwitterStreamClientApplication.java:73)
at pt.sapo.labs.TwitterStreamClientApplication.start(TwitterStreamClientApplication.java:57)
at pt.sapo.labs.Main.main(Main.java:39)
Caused by: java.lang.ClassNotFoundException: scala.Serializable
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
... 17 more
这是我的 META-INF/MANIFEST.MF
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Build-Jdk: 1.6.0_24
Main-Class: pt.sapo.labs.Main
Class-Path: lib/twitter4j-async-3.0.4-SNAPSHOT.jar lib/twitter4j-core-
3.0.4-SNAPSHOT.jar lib/twitter4j-stream-3.0.4-SNAPSHOT.jar lib/log4j-
1.2.16.jar lib/jackson-mapper-asl-1.9.5.jar lib/jackson-core-asl-1.9.
5.jar lib/commons-httpclient-3.1.jar lib/commons-logging-1.0.4.jar li
b/commons-codec-1.2.jar lib/httpcore-4.1.4.jar lib/httpclient-4.1.3.j
ar lib/httpmime-4.1.3.jar lib/commons-io-2.3.jar lib/jcl-over-slf4j-1
.6.4.jar lib/slf4j-api-1.6.4.jar lib/wstx-asl-3.2.7.jar lib/stax-api-
1.0.1.jar lib/slf4j-jdk14-1.6.4.jar lib/log4j-over-slf4j-1.6.4.jar li
b/mongo-java-driver-2.7.3.jar lib/kafka_2.9.2-0.7.0.jar lib/zookeeper
-3.3.4.jar lib/zkclient-0.1.jar lib/scala-compiler-2.8.0.jar lib/scal
a-library-2.8.0.jar
我像往常一样运行我的罐子。
java -jar reaction-twitter-streaming-client.jar
我想了解为什么它给了我这个例外。