Sunday, September 21, 2008

Adding Libraries to Eclipse Project-Tomcat Eclipse Set Up-Step 9

In a normal project you will need libraries to perform many functions in your system. In Java these libraries are usually jar files. See my prior posts on creating a project in Eclipse. After you have completed your project creation, you need to add the libraries to your library folder in your project.

You should now add your libraries to your Eclipse project. Open the xerces folder and copy the xerces.jar file into your lib directory which is in your WEB-INF directory in eclipse.

Copy the all the jar files from struts-1.3.8-all lib directory into the lib folder in your WEB-INF.

You will also need to copy the servlet-api in your lib directory which is located in your tomcat directory/common folder.

You should also copy the jars (xalan.jar,xml-apis.jar, xercesImpl.jar and serializer.jar ) into your lib directory from the xalan folder.

When you have all of your libraries in your lib directory,  you should set your buildpath to these libraries so eclipse will know about them.

The way you need to do this is by selecting the right mouse button on your project name (in our case UserBook) and select properties. You should select Java Build Path. Select the properties tab and select Add External jars. You should locate the lib directory in your workspace and select all the jar files and press okay. All the jar files should show up as references to the lib directory in your WEB-INF directory.

You should also configure Tomcat by selecting Windows->Preferences. In that window you should select your Tomcat version which is 5.x. You will also need to browse to the Tomcat Home path which might be C:\Tomcat (should be where your Tomcat instance is located). This tells Eclipse where your Tomcat is located.

Now see my next post for setting up your first struts 1.x application.

Go To Step 10

0 comments: