File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes How to call a local class from a servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to call a local class from a servlet?" Watch "How to call a local class from a servlet?" New topic

How to call a local class from a servlet?

Raj S Kumar
Ranch Hand

Joined: Aug 06, 2006
Posts: 48
I have a Jar file(an application) which works with some other third party applications(exe files) in the machine.
Now, I have to call the Jar file from a web application, which in turn should work with the Third party applications.

How this could be solved?

Please Help me on this.

Thanks in Advance

Raj S Kumar
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63866

Include the jar as part of the web app by placing it in WEB-INF/lib.

[Asking smart questions] [About Bear] [Books by Bear]
Mayuresh H. Trivedi

Joined: Jan 16, 2008
Posts: 5

you might required to put your jar and exe file (if it requires ) in lib folder.

then you may reference it in your application.

hope it works.

let me know if you want any thing else.

Thanks & Regards,
vijin das
Ranch Hand

Joined: Jun 07, 2010
Posts: 129

Explain like whether you would like to run this jar as a separate process which will be running on the local machine ??....

arriesh chellu

Joined: Jan 18, 2010
Posts: 7
C as said by the professionals above just place the jar file in the "lib" folder of your application and then restart the server and then run your application
the jar file which you have placed will automatically be referenced by the application...

and regarding the exe files where ever you are using the exe just give the path of that exe and mind it you placce the exe in the same path as given in the code of your library class....
I agree. Here's the link:
subject: How to call a local class from a servlet?
It's not a secret anymore!