What would cause a jar to be added successfully to an Eclipse Java project but then at runtime some of the classes from that jar are not found with ClassNotFound exceptions?
views:
1028answers:
3The CLASSPATH variable at runtime is likely set incorrectly or you missed adding some classes to your jar file.
@ojblass almost certainly has it right. Just to extend it, you can dump the jar file with the jar(1) tool and see if the class is there. I've had surprises from Eclipse where the project definition didn't understand what was to go into a jar file I was generating to run with java -jar
.
Everybody seems to be on the right track. Why don't you, while you have the jar unzipped, add the entire thing as a source folder in your eclipse project to see if you can even load it that way? Sometimes, depending on the classloader, you can get the CNFE if your class is available multiple times on the classpath... the classloader just bails because it doesn't know which one to use.