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.
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:/.