Reputation: 41
I'm importing several JARs all sitting in the same directory. When my program runs I'm able to access the classes in several of those JARs, no problem. So my classpath is fine (I assume). But there is one JAR giving me trouble. When I try to run:
Configuration conf = new BaseConfiguration();
I get a NoClassDefFoundError
error. The searching I did on "NoClassDefFound
" typically points to classpath problems but as mentioned above, other JARs in the same directory are being found so I think that's not the problem.
This is in Eclipse 3.8.
The import statements:
import org.apache.commons.configuration.BaseConfiguration;
import org.apache.commons.configuration.Configuration;
And the name of the JAR is:
commons-configuration-1.6.jar
Any ideas?
Tom
Upvotes: 1
Views: 54
Reputation: 25623
Perhaps it's failing to load a dependency of one of the classes in commons-configuration-1.6.jar
? Maybe from another commons-
JAR? The NoClassDefFoundError
should tell you which class the runtime failed to load. Have you checked this?
Upvotes: 1