Log4j java.lang.NoClassDefFoundError
I couldnt understand what is causing this error:
ERROR>Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/PropertyConfigurator
ERROR>Caused by: java.lang.ClassNotFoundException: org.apache.log4j.PropertyConfigurator
Already got the log4j-1.2.8.jar
everywhere in the project bu开发者_开发知识库t I couldnt make it. How can I make this error go away? Thanks!
Well, you haven't said what kind of application this is or basically given us any context. You need to make sure that the log4j classes are available to the classloader which is loading your application. If it's a standalone application run from the commandline, that's like to just be a case of specifying the -classpath
command-line option. For example:
java -classpath .;log4j-1.2.8.jar org.foo.MyApplication
If you can give us more information, we're likely to be able to help you more.
Setp 1 : right click on your main method
Step 2 go to run as option then
Step 3 go to Run configuration
Step 4: and add projects or jar files
now it works.
精彩评论