Eclipse Java EE透视图下看不见Referenced Libraries解决办法

Eclipse Java EE透视图看不见Referenced Libraries解决办法

    

    一直使用Maven,工程中所有依赖的jar包都会在Maven Dependencies目录下,今天用Eclipse IDE for Java EE Developers(版本3.6)导入一个没有使用Maven管理的老项目,以往依赖的包都会在Referenced Libraries目录下,但在Java EE透视图居然所有的Jar包都在项目根目录下(如图),看起来非常不爽,需要解决这个问题。

    

    事实上是笔者忽略了一个细节,即Project Explorer与Package Explorer的区别,在Package Explorer窗口中会出现Referenced Libraries,但Java EE 透视图中默认左边只有Project Explorer窗口。因此只要打开Package Explorer窗口即可,打开方法:菜单Window->Show View->Other->Java->Package Explorer,如果Package Explorer窗口中仍不见Referenced Libraries目录,则可以点击Package Explorer窗口右上角的倒三角箭头,在弹出的菜单中选择“Show 'Referenced Libraries' Node.” 。

    Package Explorer窗口也可将项目分组,当项目超过10个时可以进行分组显示,设置过程是:

    点击Package Explorer窗口右上角的倒三角箭头,在弹出的菜单中选择Top Level Elements->Working Sets

    再在该菜单中点击Configure Working Sets,即会弹出分组编辑器。这里可以随意创建分组,创建和编辑分组时,同时可以将项目设定到该组下,完成后Package Explorer窗口中的顶级元素不再是项目了,而是创建的分组,分组下面才是真正的项目。

    当然这是一篇很低级的博客,但居然也有和笔者一样一根筋的老外,文摘:

    

How do I hide Referenced Libraries in Eclipse's Java EE perspective?

Eclipse's normal Java perspective seems to hide Referenced Libraries just fine (in a "Referenced Libraries" folder in your project). Unfortunately, the Java EE perspective does not seem to have this same feature and enabling it is non-intuitive.

Can anyone shed some light on this issue?


Answer:
----------------------------------
The "Referenced Libraries" view is available in the Java perspective, in the Package Explorer view.

In the Java EE perspective, the Project Explorer view is the default (as opposed to the Package Explorer view). Therefore, if you wish to view the Referenced Libraries, you must open the Package Explorer view in the Java EE perspective.

Note that this view will not remove the user libraries that have been added to the project. The use of Referenced Libraries is primarily for user jars, or jars internal to the project, often placed under the lib directory of the project.

-----------------------------------
First, bring up the "Package Explorer" view (instead of the "Project Explorer" view).

Then, if the referenced .jar files still are visible in the root of the project, click on the little "down arrow" icon in the top-right corner of the Package Explorer view. In the context menu that appears, one of the items on the menu is "Show 'Referenced Libraries' Node." Click on that menu item.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值