I am using pdfbox in java to convert pdf to images. But when I compile I got the message
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
.
Here is the code I am following. Kindly help me to get out of this error.
lang. NoClassDefFoundError is a common error in Java that occurs if a ClassLoader cannot find a particular class in the classpath while trying to load it. The Exception in thread "main" suggests that this error has occurred in the main thread, the thread which is responsible for running the Java application.
lang. NoClassDefFoundError, which means the Class Loader file responsible for dynamically loading classes can not find the . class file. So to remove this error, you should set your classpath to the location where your Class Loader is present.
jar : org apache « o « Jar File Download. The download jar file contains the following class files or Java source files.
You need the Apache Commons Logging library on your classpath.
Chances are that you're missing all the dependencies of PDFBox:
Add commons-logging.jar file to your project classpath. that will fix the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With