我想在我的 java 项目中为地图使用 Trove-1.0.2 jar。我使用 Eclipse IDE。我在构建路径中使用“添加外部 jars”添加了 Trove jar,但我仍然得到 ClassNotFoundException。
但是当我检查时,类 gnu.trove.THashMap 存在于库中。
Error: java.lang.ClassNotFoundException: gnu.trove.THashMap
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)
at com.a.VCLReduce0.reduce(VCLReduce0.java:38)
at com.a.VCLReduce0.reduce(VCLReduce0.java:1)
at org.apache.hadoop.mapred.ReduceTask.runOldReducer(ReduceTask.java:519)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:420)
at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:416)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121)
at org.apache.hadoop.mapred.Child.main(Child.java:249)