Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8945635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:17:32+00:00 2026-06-15T12:17:32+00:00

I don’t know what is the problem with the program. I got this notice.

  • 0

I don’t know what is the problem with the program. I got this notice. I have set the dependencies correctly on pom.xml file.

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

pom.xml

..
<dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-api</artifactId>
  <version>1.7.2</version>
</dependency> 
..
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:17:34+00:00Added an answer on June 15, 2026 at 12:17 pm

    One simple way to avoid this warning is to add the following runtime dependency to your project’s POM

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.7.2</version>
        <scope>runtime</scope>
    </dependency>
    

    This will provide a simple logging implementation that will print your INFO level statements. You’ll quickly outgrow this solution, but it allows time to investigate the logging framework your code will eventually use.

    SLF4J is a framework designed to hide the details of how your logging is actually implemented. For example at runtime you could decide to use log4j, commons logging, Java logging or logback.

    Update 1: How to reproduce the problem

    The following Java project reproduces your issue:

    |-- pom.xml
    `-- src
        `-- main
            `-- java
                `-- HelloWorld.java
    

    Run program from Maven as follows:

    $ mvn exec:java -Dexec.mainClass=HelloWorld
    ..
    ..
    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    

    Once you add the missing dependency into your POM, your program will then have a logging implementation, which it can use to issue it’s logging statements as follows:

    $ mvn exec:java -Dexec.mainClass=HelloWorld
    ..
    ..
    [HelloWorld.main()] INFO HelloWorld - Java says: Hello world
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    

    pom.xml

    <project>
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.myspotontheweb.demo</groupId>
        <artifactId>my-project</artifactId>
        <version>1.0-SNAPSHOT</version>
        <dependencies>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>1.7.2</version>
            </dependency> 
        </dependencies>
    </project>
    

    HelloWorld.java

    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    
    public class HelloWorld {
        Logger log = LoggerFactory.getLogger(HelloWorld.class);
    
        public String speak(String speech) {
            log.info("Java says: {}", speech);
    
            return speech;
        }
    
        public static void main(String[] args) {
            HelloWorld hello = new HelloWorld();
    
            hello.speak("Hello world");
        }
    }
    

    Update 2: How to create an executable jar

    If you configure Maven to create an executable jar then it will automatically package the jar with a classpath referencing the dependencies listed in your POM file.

    $ mvn clean package
    $ java -jar target/my-project-1.0-SNAPSHOT.jar
    [main] INFO HelloWorld - Java says: Hello world
    

    pom.xml

    <project>
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.myspotontheweb.demo</groupId>
        <artifactId>my-project</artifactId>
        <version>1.0-SNAPSHOT</version>
        <dependencies>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>1.7.2</version>
            </dependency> 
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>1.7.2</version>
                <scope>runtime</scope>
            </dependency>
        </dependencies>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <archive>
                            <manifest>
                                <addClasspath>true</addClasspath>
                                <classpathPrefix>lib/</classpathPrefix>
                                <mainClass>HelloWorld</mainClass>
                            </manifest>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>copy</id>
                            <phase>package</phase>
                            <goals>
                                <goal>copy-dependencies</goal>
                            </goals>
                            <configuration>
                                <outputDirectory>${project.build.directory}/lib</outputDirectory>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </project>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Don't think my virtualhost is working correctly. This is what I have inside of
Don't know if this is an eclipse specific problem but whenever I declare a
Don't know if this is possible, but I have some code like this: val
Don't know if this has been answered before. Have custom routes to users. If
Don't know why but I can't find a solution to this. I have 3
don't know better title for this, but here's my code. I have class user
I don't know why, but this code worked for me a month ago... maybe
I don't know how better to describe this. So take this example. var a
Don't overthink this - there's a very commonly used term and I ... have
Don't know if this is the right place to ask this, but I will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.