简体   繁体   English

IntelliJ:导入的jar中的类在包中不可见

[英]IntelliJ: Classes from imported jar not visible inside packages

I added external jar file( stdlib.jar on picture) to my project in IntelliJ(12.1.4), but when I want to use some static methods from it in created package ( ChapterOne ) it can't resolve it. 我在IntelliJ(12.1.4)中的项目中添加了外部jar文件( stdlib.jar上的stdlib.jar ),但是当我想在创建的ChapterOne )中使用它的一些静态方法时,它无法解析。 However it finds classes in default package without problem . 但是,它可以在默认程序包中找到类而没有问题 How I can make it work ? 我如何使它工作?

It seems that dependencies are ok. 似乎依赖关系还可以。

The libraries were configured correctly in IDEA, but the jars actually contained sources, not classes. 这些库在IDEA中已正确配置,但jar实际上包含源,而不是类。 So the solution is to unpack these sources from the jar files into the module src directory. 因此,解决方案是将这些源文件从jar文件解压缩到模块src目录中。

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

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