开发者

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

开发者 https://www.devze.com 2023-04-07 08:35 出处:网络
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:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号