wood burning stoves
The moose likes Servlets and the fly likes library directory again Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "library directory again" Watch "library directory again" New topic

library directory again

Bob Moranski
Ranch Hand

Joined: Nov 22, 2000
Posts: 177
Hi, I recently downloaded Acme API and I was wondering where I should place it so the servlets can use it. Thanks!
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
Where you place third-party APIs depends both on how available you want to make them to other software, how they are packaged, and which servlet container you are using.
If your extra classes are in one or more jar files, and you wish to make them available to all your Java programs, just put the jar file(s) in the jre/lib/ext directory of your Java SDK. If you have jar files and you want to make them available to all your servlets you may have a directory scanned by the servlet container Resin looks in resin/lib, for example. If you only want to make the jar files visible to a single web-app or even just a single servlet, you will need to add a <classpath> tag to your server configuration file or to the web.xml file for your web app.
If you just have a directory structure full of class files, you can either jar them up and use the methods above, or add their location to either your system classpath, or add their root directory in a <classpath> tag as above.

Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
I agree. Here's the link: http://aspose.com/file-tools
subject: library directory again
jQuery in Action, 3rd edition