简体   繁体   中英

Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

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.

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.

您需要确保apache库在运行时位于类路径上。

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.

Is the commons logging jar on the classpath? You can download this from Download Commons Logging

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM