mark
mark

Reputation: 959

Java build path, differences between Library tab and Order And Export Tab

What's the difference between Library tab and Order And Export Tab?

I have imported some external jars by adding them in the Library tab. Then they appeared in the Order and Export tab. If I check the boxes on this last tab, I get a duplicate resource error when running my application.

So, what is the purpose of that boxes?

Upvotes: 2

Views: 1060

Answers (2)

cнŝdk
cнŝdk

Reputation: 32145

The user Library tab is used to:

Define personal librairies by adding, editing and removing Jars to this personal library, the purpose here is that you don't have to always import all the jars in every project build-path, you just need to put them in a user library(once) and then include this personal library to any project build-path.

And the Order Export/import tab:

Is generally used to set the order of how your librairies will be parsed by the Java Compiler. Because in some cases the order of Librairies is important and may cause problems.

Take a look here for more information:

User Libraries Preferences

Java Build Path-Order and Export tab

Upvotes: 2

Mustafa sabir
Mustafa sabir

Reputation: 4360

Reading from eclipse user guide

A user library is a set of JAR files. A user library can be added to a projects build path through the build path properties page. The User Libraries preference page allows to define, edit, import, export, or remove user libraries.

Order and export tab is mainly used to export jars to other dependent project. For an example, suppose I have two projects . Project1 has sample.jar added in its libraries, hence it can directly reference and use its resources. There is another project2 dependent on project1 which also needs sample.jar, so either I check the jar in project1's Order and export tab , or add it in project2's libraries. Note that this feature is useful when there are many dependent projects in your workspace.

It is also used to specify the order (by moving libraries up and down) ,as the order of resolution for resources used during project build.

Upvotes: 2

Related Questions