How do I create an Eclipse User Library for the Tomcat jar files?
Author: Deron Eriksson
Description: This tutorial describes how to create an Eclipse User Library for the various Tomcat jar files.
Tutorial created using: Windows Vista || JDK 1.6.0_04 || Eclipse Web Tools Platform 2.0.1 (Eclipse 3.3.1) || Tomcat 6.0.14

An EclipseSW User Library can be used to represent a set of jarW files. This user library can be added to a project's classpathW. Thus, a user library can be a convenient way to add a set of jar files (rather than individual jar files) to a project's build path. Here, I'll create a user library for a set of TomcatSW jar files.

To create a user library, you can go to Window → Preferences and go to JavaSW → Build Path → User Libraries. I'll click the New button to create a new user library.

New User Library

I named my new user library "TOMCAT_6.0.14_LIBRARY" and clicked OK.

Create TOMCAT_6.0.14_LIBRARY User Library

I selected TOMCAT_6.0.14_LIBRARY and clicked the "Add JARs" button.

Add jars to library

I browsed to my Tomcat bin directory and selected 3 jar files, including the bootstrap.jar file. I added these to my user library.

Select jars

Next, I clicked Add JARs again and this time browsed to my Tomcat lib directory and selected several jar files, shown below.

Select more jars

When done, my TOMCAT_6.0.14_LIBRARY consisted of several jar files, shown below. I clicked OK to save this library.

Click OK to save library

After doing this, if I have a web application project that will run in Tomcat in Eclipse, I can add the TOMCAT_6.0.14_LIBRARY to the classpath to have all the necessary Tomcat jar files automatically added to the project's classpath.