关于此主题的现有stackoverflow问题都表明我有类路径问题。但是,它看起来是正确的。任何帮助非常感谢。 TIA。
~$ echo $JAVA_HOME; echo $PATH
/usr/local/jdk1.7.0_71
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/jdk1.7.0_71/bin
~$
~$ ll /usr/local/cassandra-java-driver-3.0.0/lib/cassandra-driver-core-3.0.0.jar
-rw-r--r-- 1 root root 990392 May 2 21:36 /usr/local/cassandra-java-driver-3.0.0/lib/cassandra-driver-core-3.0.0.jar
~$
~$ java -classpath ./:/usr/local/cassandra-java-driver-3.0.0/lib/cassandra-driver-core-3.0.0.jar -jar CassandraFunctionalTests.jar
Exception in thread "main" java.lang.NoClassDefFoundError: com/datastax/driver/core/Cluster
at com.seagate.bdcauto.cassandratests.CassandraLabConnector.<init>(CassandraLabConnector.java:13)
at com.seagate.bdcauto.cassandratests.FunctionalTests.main(FunctionalTests.java:7)
Caused by: java.lang.ClassNotFoundException: com.datastax.driver.core.Cluster
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)
... 2 more
~$