Results 1 to 12 of 12
- 02-06-2009, 03:21 PM #1
- 02-08-2009, 12:19 PM #2Member
- Join Date
- Jan 2009
- Rep Power
You just have to set a path variable in your environment settings.
Add a path of your jar file in your "PATH" variable.
- 02-08-2009, 03:43 PM #3
How to add a jar file
I have just gone through the frustrating exercise of trying to add a jar file to my computer. For Windows systems, the jar file has to explictly listed in the CLASSPATH environment variable. For example, if I want to add a jar file (mail.jar) so it can be used by my Java programs, I would have to add the following to my CLASSPATH:
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.
- 02-09-2009, 03:25 AM #4
- 02-09-2009, 03:42 AM #5
I noticed you are using javax.servlet, which indicates you are using a Web application server. I assume you want to access the classes in the JAR from your Web application
Web application servers run your application for you, and they have very particular places were everything goes, including JAR files. Since the javax.servlet JAR is likely to be used by many applications, it makes more sense to load it in the WAS /common/lib directory, which is shared by all applications. If you have a JAR that is specific to your application, there is typically a /lib folder in your application structure where the JAR file goes.
Look at the documentation for your WAS. They are normally very good about telling you where to put things.
- 02-09-2009, 04:00 AM #6
- 02-09-2009, 02:42 PM #7
Actually, at least on Tomcat, there are at least three types of /lib folders. Unfortunately, I don't have my Tomcat virtual machine available right now, so I'm going by memory, and I'm sure to give some wrong names...
- /shared/lib is for JAR's shared by applications and the server itself. Don't use this folder unless you have a good reason and you know what you are doing
- /common/lib is for JAR's shared by all applications
- I can't remember the parent directory name, but each application has a /lib directory in the application resources directory. This is for application specific JAR's
Just as well that I don't remember the exact names. I'm sure they are dependent on the WAS. Bottom line, read the documentation.
- 02-10-2009, 02:42 PM #8
Hello thanks a lot for your response..
can u tell me a exact path for that..
i am waiting for your valuable replyMak
(Living @ Virtual World)
- 02-10-2009, 03:30 PM #9
Mak, the path depends on which WAS you are using, what OS it is installed on, where it was installed, and how it was configured.
All I can suggest is to look at the WAS documentation, which will almost always tell you exactly where to put things. After you read the documentation, if you can, find someone who knows about this server and have them show you around.
- 02-11-2009, 04:11 AM #10
- 02-11-2009, 04:49 AM #11
More than you bargained for, huh?
The application folder is WEB-INF/lib. WEB-INF/class is the root of the application CLASSPATH, for classes that are not put in JAR's.
- 02-11-2009, 04:51 AM #12
- By Java Tip in forum Java TipReplies: 1Last Post: 04-18-2009, 10:03 AM
- By Zosden in forum Advanced JavaReplies: 3Last Post: 07-26-2008, 04:33 AM
- By Java Tip in forum javax.swingReplies: 0Last Post: 06-27-2008, 07:43 PM
- By revathi17 in forum New To JavaReplies: 1Last Post: 10-17-2007, 10:17 AM
- By drveresh in forum Advanced JavaReplies: 1Last Post: 07-03-2007, 02:01 PM