ClassNotFound Exception log4j only when running exported executable jar on cmd

501 views Asked by At

I'm successfully running a Java console based program inside eclipse. But when I export external jar it throws me ClassNotFound Exception for class log4j. Its working perfectly inside eclipse, but when I execute exported jar with java -jar filename.jar it gives me error

enter image description here

I have also added the external jar of log4j in my eclipse project enter image description here

And as well as to my build path, but still no result

enter image description here

1

There are 1 answers

0
Arpit Aggarwal On BEST ANSWER

Can you check if you have log4j dependencies in your exported jar. Because you are adding jars in a Build Path it might be not present in exported jar.

Here you can find how to include external dependencies in your exported jar.