File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How to make available a jar file globally...? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to make available a jar file globally...?" Watch "How to make available a jar file globally...?" New topic
Author

How to make available a jar file globally...?

Nagendhra Kumar
Greenhorn

Joined: Aug 28, 2006
Posts: 5
Hi Friends,

Can anyone tell me how to make a jar file available globally(i mean available from any directory) so that i can run it from any directory...?

I followed the following steps eventhough i could't solve this...?

1. I created a jar file in a directory(say D:\hello.jar).
2. I set the classpath variable in the classpath.
3. Now I am trying to run that jar file from other drive(say E:\java hello.jar) but i am not able to run this...I am encountering NoClassFoundException.

Thanks in advance.
tn
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
What is your CLASSPATH?
Nagendhra Kumar
Greenhorn

Joined: Aug 28, 2006
Posts: 5
My classpath is .;E:\hello.jar;
....is anything wrong with this classpath..?
Darryl Failla
Ranch Hand

Joined: Oct 16, 2001
Posts: 128
Create a regular .java (mine.java) file in which you import hello. Create your class as you normally would. Somewhere in that jar file, you have a class that you can instantiate. Create an instance of the class and write code to do whatever you need with it.

Save mine.java and compile it. Then run E:\java mine. Whatever you have programmed to happen should happen. Your classpath looks OK if hello.jar resides in the root directory of E:/.


Darryl Failla
Sun Certified Java 2 Programmer
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
include the jar path in your CLASSPATH.


Rahul Bhattacharjee
LinkedIn - Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to make available a jar file globally...?