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
I have also added the external jar of log4j in my eclipse project
And as well as to my build path, but still no result
Can you check if you have
log4j
dependencies in your exportedjar
. Because you are adding jars in aBuild Path
it might be not present in exportedjar
.Here you can find how to include external dependencies in your exported
jar
.