java 使用 Apache Poi 读取 Excel 时出现 ListValuedMap NoClassDefFoundError?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/45657641/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ListValuedMap NoClassDefFoundError when Reading Excel using Apache Poi?
提问by vamshi
While Executing the Program, Below are the issues Compiler is throwing
在执行程序时,以下是编译器抛出的问题
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/collections4/ListValuedMap
at ReadExcel.main(ReadExcel.java:19)
Caused by: java.lang.ClassNotFoundException:
org.apache.commons.collections4.ListValuedMap
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more
Please help me know how to solve this Thanks in advance
请帮我知道如何解决这个提前谢谢
回答by kattoor
you should be good if you add the below jar. https://mvnrepository.com/artifact/org.apache.commons/commons-collections4/4.1
如果您添加以下 jar,您应该会很好。 https://mvnrepository.com/artifact/org.apache.commons/commons-collections4/4.1
回答by Jason J
You are missing some required class maybe check your version on pom.xml if you are using eclipse you can do cnt shift T and see if you can open the missing class (ListValuedMap)file and see if it comes from the same jar as you specified in your pom.
您缺少一些必需的类,也许在 pom.xml 上检查您的版本,如果您使用的是 eclipse,您可以执行 cnt shift T 并查看您是否可以打开缺少的类 (ListValuedMap) 文件,看看它是否来自您指定的同一个 jar在你的 pom.