编译java文件生成class文件后,运行class总是提示缺少hadoop中的各种包,是怎么回事?
例如:Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.collect.MapMaker.keyEquivalence(Lcom/google/common/base/Equivalence;)Lcom/google/common/collect/MapMaker;
at com.google.common.collect.Interners$WeakInterner.(Interners.java:68)
at com.google.common.collect.Interners$WeakInterner.(Interners.java:66)
at com.google.common.collect.Interners.newWeakInterner(Interners.java:63)
at org.apache.hadoop.util.StringInterner.(StringInterner.java:49)
at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2611)
at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2503)
at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2409)
at org.apache.hadoop.conf.Configuration.get(Configuration.java:982)
at org.apache.hadoop.mapred.JobConf.checkAndWarnDeprecation(JobConf.java:2032)
at org.apache.hadoop.mapred.JobConf.(JobConf.java:428)
at org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.getS3Conf(HExecutionEngine.java:117)
at org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.init(HExecutionEngine.java:209)
at org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.init(HExecutionEngine.java:111)
at org.apache.pig.impl.PigContext.connect(PigContext.java:311)
at org.apache.pig.PigServer.(PigServer.java:226)
at org.apache.pig.PigServer.(PigServer.java:214)
at org.apache.pig.PigServer.(PigServer.java:187)
at org.apache.pig.PigServer.(PigServer.java:179)
at App.main(App.java:15)
等等。。。按照所有的报错提示添加jar后报:Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.collect.MapMaker.keyEquivalence(Lcom/google/common/base/Equivalence;)Lcom/google/common/collect/MapMaker;
at com.google.common.collect.Interners$WeakInterner.(Interners.java:68)
at com.google.common.collect.Interners$WeakInterner.(Interners.java:66)
at com.google.common.collect.Interners.newWeakInterner(Interners.java:63)
at org.apache.hadoop.util.StringInterner.(StringInterner.java:49)
at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2611)
at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2503)
at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2409)
at org.apache.hadoop.conf.Configuration.get(Configuration.java:982)
at org.apache.hadoop.mapred.JobConf.checkAndWarnDeprecation(JobConf.java:2032)
at org.apache.hadoop.mapred.JobConf.(JobConf.java:428)
at org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.getS3Conf(HExecutionEngine.java:117)
at org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.init(HExecutionEngine.java:209)
at org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.init(HExecutionEngine.java:111)
at org.apache.pig.impl.PigContext.connect(PigContext.java:311)
at org.apache.pig.PigServer.(PigServer.java:226)
at org.apache.pig.PigServer.(PigServer.java:214)
at org.apache.pig.PigServer.(PigServer.java:187)
at org.apache.pig.PigServer.(PigServer.java:179)
at App.main(App.java:15)