Well, you didn’t say what kind of application it was, or basically you gave us some kind of context. You must ensure that the log4j classes are accessible to the class loader loading your application. If this standalone application is launched from the command line, this is similar to the case of specifying a command line option -classpath. For instance:
java -classpath .;log4j-1.2.8.jar org.foo.MyApplication
If you can provide us with more information, we are likely to be able to help you.
source
share