Error: Package Org. Slf4J Does Not Exist

Error: Package Org. Slf4J Does Not Exist

I am attempting to create a program in Java using Netbeans. I am attempting to use org.slf4j. I think I have placed the sufficient amount of slf4j jar files in my CLASS PATH. I have placed slf4j-api, slf4j-jcl, slf4j-jdk14, slf4j-nop and slf4j-simple in my class path.

My question is: Am i placing the wrong jar files in my class path, the Zip file for the slf4j folder included a large amount of jar files. Why are there so many executable jar files included for SLF4J.

Ultimately, the program needs to compare 2 pdf files at a time and spit out an error message if the files are different. Would anyone know if there is anything out there that I can include so I don't have to deal with this SLF4J package. Below is where I am attempting to run the package.

import org.slf4j.Logger;

import org.slf4j.LoggerFactory;

5

3 Answers

Set Dependencies as follows.

In Maven

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>version number</version>
</dependency>

In Gradle

dependencies {
   compile group: 'org.slf4j', name: 'slf4j-api', version: 'version number'
}
4

In Gradle add the following dependencies:

implementation 'org.slf4j:slf4j-api:1.7.28'
implementation 'org.slf4j:slf4j-simple:1.7.28' 

The last one dependency needs to be added to Resolve "Failed to load class org.slf4j.impl.StaticLoggerBinder"

In build.gladle ( the second one ) look at dependencies and add this line:

dependencies {
   ...
   implementation 'org.apache.directory.studio:org.slf4j.api:1.7.2'
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

David Miller
Author

David Miller

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.