IntelliJ:来自导入jar的类在包内不可见 [英] IntelliJ: Classes from imported jar not visible inside packages

查看:211
本文介绍了IntelliJ:来自导入jar的类在包内不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IntelliJ(12.1.4)的项目中添加了外部jar文件(图片中的 stdlib.jar ),但是当我想使用它的一些静态方法时在创建的 ChapterOne )中,它无法解决它。 但是它在默认包中找到没有问题的类 。我如何才能使它发挥作用?

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. However it finds classes in default package without problem. How I can make it work ?

似乎依赖性正常。

推荐答案

库已正确配置IDEA,但罐子实际上包含来源,而不是类。因此解决方案是将这些源从jar文件解压缩到模块 src 目录。

The libraries were configured correctly in IDEA, but the jars actually contained sources, not classes. So the solution is to unpack these sources from the jar files into the module src directory.

这篇关于IntelliJ:来自导入jar的类在包内不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆