• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JAR vs EXTERNAL JAR in Eclipse Build Path

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
What is difference between Jar and External Jar in Eclipse Build Path?

Thaks for your help.
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From eclipse help, difference is whether the jar is in your workspace or not:


Adding a JAR file to the build path
You can add a JAR file stored either in the workbench or anywhere in your file system to the build class path.

To add a JAR to your build class path follow these steps:

Select the project, and from its pop-up menu, select Properties. In the Properties dialog, select the Java Build Path page.
Click the Libraries tab.
You can now either add a JAR file which is contained in your workspace or which is somewhere else:
--to add a JAR file which is inside your workspace click the Add JARs button
--to add an external JAR file click the Add External JARs button
In the dialog that appears, select the JAR file that you want to add. Note that you can add multiple JARs at once.


[ April 04, 2005: Message edited by: Carol Enderlin ]
 
Kshitij Ktambe
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Carol,
Thanks for your reply.
I am still not clear what is the need of differentiating between the two?
 
author & internet detective
Posts: 41915
910
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kshitij,
Usually you use the regular jar option. This is for projects that are part of your application and get deployed with it.

Sometimes you need to access a jar that resides somewhere else. A common example is a database driver, which gets installed in the database directory. This doesn't get deployed because you expect it to be available in the production environment too. In this case, you use an external jar.
 
Kshitij Ktambe
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Carol & Jeanne
Thanks a lot for your help
 
Saloon Keeper
Posts: 27882
197
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Concrete example:

I need the HttpServlet class definitions in a project. These class definitions are normally in a jar in the appserver (for example, servlet.jar in Tomcat4). Rather than copy servlet.jar into the project, I make an external reference. That way I don't have to copy servlet.jar to each webapp project. This is espeically important when working with appservers who keep their servlet classes in some huge jar that changes often.

Additionally, I set the servlet jar reference in an environment variable. This way, no absolute paths exist that will break when I come back in a year or 2 or install the project on someone else's machine.
 
What's gotten into you? Could it be this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic