I'm using eclipse and I imported a library into my project through the option
Add External Archives...
I imported the library --> import jdbm.helper.Conversion; in my code, used the methods i needed and ever thing compile right
(by the way I'm running this from main() )
so i type java maintest in command prompt to run the program and i get:
Exception in thread "main" java.lang.NoClassDefFoundError: jdbm/helper/Conversion
the jar file that i'm using is in C:\Program Files\Java\jdk1.6.0\jdbm-1.0\lib
I put this path in my CLASSPATH variable and still nothing
what to I do?
You're close, I think. If you want a jar file to be in your classpath, you have to use the full path to that jar file, including the name of the jar file, in the classpath definition. Just using the path of the directory containing the jar file isn't enough.
Check (using dir) that the .jar file is where you expect it to be, and (using echo) that the CLASSPATH variable is what you expect it to be.
Also try using the -cp switch when you invoke java, rather than relying on the CLASSPATH variable which is the source of much misery. As noted above the classpath specified should include the full path and name of the .jar file containing the jdbm.helper package.