我有一个简单的类,它从另一个 jar 导入另一个类。一切都编译得很好,但试图运行它......
$ jar tvf ../../pig-2.1.jar | grep TupleFact
1641 Mon Feb 02 17:56:32 UTC 2009 org/apache/pig/data/DefaultTupleFactory.class
2289 Mon Feb 02 17:56:30 UTC 2009 org/apache/pig/data/TupleFactory.class
$ javac ../src/Convert.java -classpath `echo ../lib/* ../../lib/* | sed 's/ /:/g'`
$ java Convert -classpath `echo ../lib/* ../../lib/* | sed 's/ /:/g'`
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/pig/data/TupleFactory
at Convert.<clinit>(Convert.java:31)
Caused by: java.lang.ClassNotFoundException: org.apache.pig.data.TupleFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
... 1 more
有任何想法吗?你如何开始调试这个?