This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
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:/.