简体   繁体   中英

How to know the jar files being used in eclipse

I have a java project which uses apache poi jars.

In eclipse referenced libraries two versions of poi jar is available. poi3.5 and poi3.7.

In java code im using

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

In eclipse how to know which version of the jar file it will refer. IF there are two versions of same jar file available in class path, which one will it take?

Edit:-

In eclipse i had seen someone using a keyboard shortcut over that import statements to show the correct 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.

To access directly a class in the right Jar just press CTRL and click on the class name.

Of course, having two different versions of the same Jar is a configuration bug: you should remove one of them. Also consider that the order you have in Eclipse could be different from the order in another execution environment (for example an application server).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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