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

jar files

Suka Hati
Ranch Hand

Joined: Oct 28, 2004
Posts: 56
i have a jar files which i store in web-inf/lib in my web application folder. if i want to call a class in the jar files from my servlet, how am i going to do that?
Anthony Watson
Ranch Hand

Joined: Sep 25, 2003
Posts: 327
You just import the class into your code and instantiate the objects as usual.
Suka Hati
Ranch Hand

Joined: Oct 28, 2004
Posts: 56
i try to do that but i still got error which says the package does not exist. and one more question is can u tell me about this error

.....cannot resolve symbol
Fisher Daniel
Ranch Hand

Joined: Sep 14, 2001
Posts: 582
Hi Suka Hati,
That error is raised by compiler when it doesn't find proper class which you use because you dont give the proper classpath of the library.

May I know what class you used?

As you said that you build a web application, i think it is the best way to check again the directory structure of your web application.
All the extended library, you use, is placed on <web-app>\WEB-INF\lib

Hope this help
Correct me if I am wrong
thanks
daniel
Suka Hati
Ranch Hand

Joined: Oct 28, 2004
Posts: 56
hi...

i do put my .jar files in folder tomcat/webapps/speech/WEB-INF/lib/**.jar

i just need to import it as usual...(like below)

import ***.*;

and call the class that i need in those .jar files....(like below)

Try try=new Try();

is it true, or there's other way to do it?
Fisher Daniel
Ranch Hand

Joined: Sep 14, 2001
Posts: 582
Hi Suka Hati,
I think you are right about that.
And you can use class on that library and it should run well...
Let me know what's error you have when you run that application...

thanks
daniel
Suka Hati
Ranch Hand

Joined: Oct 28, 2004
Posts: 56
the error that i got is:

package *** does not exist

should i add the path of the package in the CLASSPATH....actually i have done it but there's no different
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jar files
 
Similar Threads
Rampart at the client side
Getting Error in setting property values
using the display:table tag
Eclipse Packaging files
Problem in jsp while using standard action