简体   繁体   English

如何在Eclipse的library文件夹中组织jar文件?

[英]How to organize jar files in a libraries folder in Eclipse?

I have a Java Project in Eclipse, and a Java Dynamic Web Project in Eclipse. 我在Eclipse中有一个Java项目,在Eclipse中有一个Java动态Web项目。 In the former, all the jar files are shown individually under the top-level project folder. 在前者中,所有jar文件都分别显示在顶级项目文件夹下。 In the latter, the jar files are under a Libraries folder and the navigation is more convenient. 在后者中,jar文件位于Libraries文件夹下,导航更加方便。

Is it possible to organize them in the same way in the Java Project also? 是否可以在Java Project中以相同的方式组织它们? If so, how? 如果是这样,怎么办?

Update: It is the Project Explorer View. 更新:这是项目资源管理器视图。 For the Java Project, I see: "my_project_name" with the arrow expanded to point downwards, then I see: "package_icon src/main/java" and below that "package_icon src/main/resources" and then 20 jar files one below the other: "jar_icon activation-1.1.jar", ... 对于Java项目,我看到:“ my_project_name”,其箭头扩展为指向下方,然后我看到:“ package_icon src / main / java”和其下的“ package_icon src / main / resources”,然后是20个jar文件(位于其他:“ jar_icon activation-1.1.jar”,...

For the Java Dynamic Web Project I see: "my_project_name" as above, then I see: "JAX-WS Web Services" (unexpanded), then "Deployment Descriptor" (unexpanded), then "Java Resources" which I have expandeded, so I see the components of it below, of which the first is: "package_icon src/main/java", then below it, "package_icon src/main/resources", then below it "libraries_icon Libraries" instead of 20 jars ! 对于Java动态Web项目,我看到:如上所述的“ my_project_name”,然后看到:“ JAX-WS Web服务”(未扩展),然后是“部署描述符”(未扩展),然后是我已扩展的“ Java资源”,因此我在下面看到它的组件,其中的第一个是:“ package_icon src / main / java”,然后在其下面的“ package_icon src / main / resources”,然后在其下面的“ libraries_icon Libraries”而不是20个罐子 I have the option of expanding Libraries if I really need to see the 20 jars. 如果我确实需要查看这20个罐子,那么我可以选择扩展库。

The only option I found to make things prettier in Eclipse Kepler is to: 我发现使Eclipse Kepler变得更漂亮的唯一选择是:

  1. In the Project Explorer window there is a down arrow in the upper right corner. 在“项目资源管理器”窗口中,右上角有一个向下箭头。 Select that and then Customize View. 选择它,然后自定义视图。

  2. Select 'Libraries from external' and then OK. 选择“来自外部的库”,然后单击确定。

Kind of cheesy... 有点俗气...

EDIT: Of course I had to go and do some more digging...and it looks like I'll have to try this and see how it works. 编辑:当然,我不得不去做更多的挖掘工作……而且看来我将不得不尝试一下 ,看看它是如何工作的。

I noticed this "feature" on Eclipse Juno (latest version), when you have a jar file added to the build path it is not shown as a single file on the project. 我在Eclipse Juno(最新版本)上注意到了这一“功能”,当您将一个jar文件添加到构建路径时,它在项目中没有显示为单个文件。

Try removing one of the jars from the build path to see if it shows up again. 尝试从构建路径中删除其中一个jar,以查看其是否再次出现。

I couldn't find how to turn it off though. 我找不到如何将其关闭。

BTW... the project layout for your "Java Project" is more akin to a "Maven Project", which is a bit more powerful. 顺便说一句...“ Java项目”的项目布局更类似于“ Maven项目”,后者功能更强大。

Similar to M Miller's answer (but for Juno), click Show 'Referenced Libraries' Node in the dropdown of the Package Explorer window: 与M Miller的答案类似(但对于Juno),在Package Explorer窗口的下拉菜单中单击Show 'Referenced Libraries' Node

参考库节点执行和结果

I'm using: 我正在使用:

Eclipse IDE for Java Developers

Version: Juno Release
Build id: 20120614-1722

You should change into the Package Explorer by Window > show View. 您应该通过“窗口”>“显示视图”更改为“包资源管理器”。 It will display all the referenced libraries in a Referenced Libraries folder. 它将在“ Referenced Libraries文件夹中显示所有引用的库。

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

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