The moose likes Tomcat and the fly likes Third Party libraries in Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "Third Party libraries in Tomcat" Watch "Third Party libraries in Tomcat" New topic
Author

Third Party libraries in Tomcat

Padma Prasad
Ranch Hand

Joined: Sep 16, 2002
Posts: 76
Hi,
I am using Tomcat for my application. My application has to display images so we are using javachart. As per the instructions, I have made classpath point to a jar file which has all the libraries for the javachart. so, I have no problems compiling a java file with chart library classes. But does Tomcat understand the system classpath? or do I need to specify some where so that tomcat understands that jar. I have put this jar file in tomcat-home/common/lib. But when I run the application, I get the exception NoClassDefFound for this javachart class.
How should I tell the tomcat to look into this jar file?
regards,
Padma.
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1177

It should be enough to put the jar file in the web application's lib folder.
'<tomcat_location>/webapps/<web_application>/WEB-INF/lib'
Rene


Regards, Rene Larsen
Dropbox Invite
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50693

Jars that are specific to a single web app should be placed in that app's WEB-INF/lib folder (as per pervious post). For jars that will be shared across more than one app, I place them in $CATALINE_HOME/shared/lib.
bear


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Padma Prasad
Ranch Hand

Joined: Sep 16, 2002
Posts: 76
Thanks Rene and Bear.
This also works by placing the jar in the $CATALINE_HOME/common/lib.
Thanks for the help.
Padma.
Padma Prasad
Ranch Hand

Joined: Sep 16, 2002
Posts: 76
continuation to my previous reply...........
It works fine if the third party jar file is placed in the $CATALINE_HOME/common/lib. I tried this before but got an error coz I placed a wrong jar file. My mistake............
 
 
subject: Third Party libraries in Tomcat
 
Threads others viewed
Regarding Jar File
EAR deployment problem Weblogic Migration... additional resources needed on classpath
WebSphere app server, shared libs and class files
still problems with tomcat
using packages
IntelliJ Java IDE