My code compiles in Eclipse but I get a ClassNotFound at runtime how can I fix it?
问题 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? 回答1: The CLASSPATH variable at runtime is likely set incorrectly or you missed adding some classes to your jar file. 回答2: @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