简体   繁体   English

项目libs文件夹中的IntelliJ库仍然无法在类路径中拾取

[英]IntelliJ library in project libs folder still unable to be picked up in classpath

I am trying to use the apache-poi-3 library, and while it works fine at compile time, running the library class/method calls returns a NoClassDefFoundError. 我正在尝试使用apache-poi-3库,尽管它在编译时可以正常运行,但运行库类/方法调用会返回NoClassDefFoundError。 I created a /libs folder under my main Project module's trunk. 我在主项目模块的主干下创建了一个/ libs文件夹。 This trunk has /src and an /out/production as well. 该主干还具有/ src和/ out / production。

My understanding of classpath for IntelliJ allows you to have the /libs folder as the root for libraries. 我对IntelliJ的类路径的理解使您可以将/ libs文件夹作为库的根目录。 Just dragging a folder of jars in there should work. 只需将一个jar文件夹拖到其中即可。

I am not sure how the process works. 我不确定该过程如何进行。 I have another library here that I just went into Project Structure-> Libraries -> new Library and even tried going to Project Structure -> Modules -> Dependancies -> add Jars/Dependencies with no luck for apache-poi-3. 我在这里还有另一个库,我刚进入项目结构->库->新库,甚至尝试去项目结构->模块->依赖关系->添加Jars / Dependencies对于apache-poi-3都没有运气。

Apache-poi-3无法将库添加到classpath.png

I solved this problem by putting all jars into the /libs/ folder. 我通过将所有jar放入/ libs /文件夹解决了这个问题。 No jars are children of any other folder other than /libs. 除了/ libs之外,jar都不是其他任何文件夹的子级。 Im pretty sure this is how it should have been deployed and zipped up as, but whatever. 我非常确定这是应该如何部署和压缩的,但是无论如何。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM