46

What is the use of Order And Export tab in Java Build Path

JJD
  • 50,076
  • 60
  • 203
  • 339
minil
  • 6,895
  • 16
  • 48
  • 55

2 Answers2

33

It allows you to do two things:

  • Determine in which order projects and libraries appear in the classpath. If there are any duplicate classes, this determines which version is loaded
  • Determine which projects and libraries will be exported and thus available in other projects that depend on this one.
Michael Borgwardt
  • 342,105
  • 78
  • 482
  • 720
  • In Eclipse, I have a project TEST which is dependent on Project TEST2 and an externat jar external.jar. While creating jar for TEST Project with Order and Export option checked , created jar is not including TEST2.jar or external.jar.. So how I can do this to run the TEST.jar idependently ? – Dhrubo Apr 19 '12 at 04:59
  • @Dhrubo: JARs cannot include other JARs. I think you can configure the JAR builder of eclipse to include all the *classes*, but the normal way to do it is to have several JARs and include them all in the classpath when running the application. – Michael Borgwardt Apr 19 '12 at 07:04
  • what difference 'checking and unchecking' a particular entry makes? – Darpan Apr 07 '14 at 11:56
  • @Darpan: only checked ones are visible to dependent projects. – Michael Borgwardt Apr 07 '14 at 12:11
  • blue dot before library name ? – Tushar Pandey Nov 06 '14 at 10:47
  • 2
    @TusharPandey: I think that happens only for the project's own source folders, which are always exported. – Michael Borgwardt Nov 06 '14 at 11:21
4

Got some hint here for you:

Order and Export. Order in which projects and libraries appear in the build path and the default runtime classpath; e.g., use classes from a workspace project before using the same classes from an archive library.

Found it on informit.com

lunactic
  • 316
  • 1
  • 5
  • 3
    Specifically, the classes higher in the list will take precedence over the classes lower in the list. – xji Jan 11 '16 at 13:08