简体   繁体   English

如何知道eclipse中使用的jar文件

[英]How to know the jar files being used in eclipse

I have a java project which uses apache poi jars. 我有一个使用apache poi jars的java项目。

In eclipse referenced libraries two versions of poi jar is available. 在eclipse引用的库中,有两种版本的poi jar。 poi3.5 and poi3.7. poi3.5和poi3.7。

In java code im using 在java代码中im使用

 import org.apache.poi.hssf.usermodel.HSSFRow;

In eclipse how to know which version of the jar file it will refer. 在eclipse中,如何知道它将引用哪个版本的jar文件。 IF there are two versions of same jar file available in class path, which one will it take? 如果在类路径中有两个版本的同一jar文件可用,它将采用哪个版本?

Edit:- 编辑:-

In eclipse i had seen someone using a keyboard shortcut over that import statements to show the correct jar. 在Eclipse中,我看到有人在该import语句上使用键盘快捷键来显示正确的jar。 Any one knows what that shortcut is? 有谁知道捷径是什么?

我认为您正在寻找快捷键ctrl + shift + t选择import语句并使用上述快捷键。

它会使用您添加的第一个库来构建通道,其他库中的其他相同软件包将被忽略

Jars are examined in the order they appear in the classpath. 按照罐子在类路径中出现的顺序检查罐子。 In Eclipse you have the "Java Build Path" dialog that contains the "Order and Export" tab: there you can read/modify the order of the libraries. 在Eclipse中,您具有包含“ Order and Export”选项卡的“ Java Build Path”对话框:您可以在其中读取/修改库的顺序。

To access directly a class in the right Jar just press CTRL and click on the class name. 要直接访问右侧Jar中的类,只需按CTRL,然后单击类名。

Of course, having two different versions of the same Jar is a configuration bug: you should remove one of them. 当然,同一Jar的两个不同版本是一个配置错误:您应该删除其中一个。 Also consider that the order you have in Eclipse could be different from the order in another execution environment (for example an application server). 还请考虑您在Eclipse中拥有的顺序可能与另一个执行环境(例如,应用程序服务器)中的顺序不同。

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

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