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开发者_StackOverflow中文版/commons/logging/LogFactory
.
Here is the code I am following. Kindly help me to get out of this error.
You need the Apache Commons Logging library on your classpath.
Chances are that you're missing all the dependencies of PDFBox:
Minimum Requirement for PDFBox
- Java 1.5
- commons-logging
Add commons-logging.jar file to your project classpath. that will fix the issue.
You need to ensure that the apache library is on your class path at runtime.
Is the commons logging jar on the classpath? You can download this from Download Commons Logging
I had the same problem and I have tried all of the solutions on the web, I had all of the required JAR files in my CLASSPATH ... but it didn't work. then I decided to move my JAR files from my DROPBOX folder to a normal folder and it worked!
So if your JARs are on dropbox or anything like that, move them to a normal folder and add them to your classpath! it will solve the java.lang.NoClassDefFoundError
exception.
精彩评论