| 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: 2341
|
|
|
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: 127
|
|
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: 2300
|
|
|
include the jar path in your CLASSPATH.
|
Rahul Bhattacharjee
LinkedIn - Blog
|
 |
 |
|
|
subject: How to make available a jar file globally...?
|
|
|