How to solve the unknown error when using slf4j in Java

In batch, log is the life, I want to use Slf4j, so download the zip. https://www.slf4j.org/download.html

From adding an external jar Add only slf4j-api-1.7.25.jar to java

@Slf4j
public class HogeMain {
  public static void main(String args[]){
     ...
     log.info("testosterone");
     ...
  }

When I write and execute, the following error

   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.

Adding slf4j-simple-1.7.25.jar will fix it.

By the way, if you get this error, you probably added an unnecessary jar.

NoClassDefFoundError: android/util/Log

slf4j-api-1.7.25.jar slf4j-simple-1.7.25.jar If you just want to log to java, just these two jars worked for the time being

Recommended Posts

How to solve the unknown error when using slf4j in Java
How to get the class name of the argument of LoggerFactory.getLogger when using SLF4J in Java
[Rails] How to solve the error "undefined method` visit'" when using Capybara with Rspec
How to get the date in java
How to solve an Expression Problem in Java
How to find the total number of pages when paging in Java
[Java] How to omit the private constructor in Lombok
How to convert A to a and a to A using AND and OR in Java
Differences in code when using the length system in Java
[Swift] How to display the entered characters in Widget via UserDefaults when using WidgetKit
Summary of how to use the proxy set in IE when connecting with Java
How to set chrony when the time shifts in CentOS7
How to dynamically switch JDK when building Java in Gradle
How to derive the last day of the month in Java
How to switch Java in the OpenJDK era on Mac
How to play MIDI files using the Java Sound API
How to learn JAVA in 7 days
How to use classes in Java?
How to name variables in Java
How to concatenate strings in java
How to solve the problem when the value is not sent when the form is disabled in rails and sent
[Java] Try to solve the Fizz Buzz problem using recursive processing
How to output the value when there is an array in the array
I tried to translate the error message when executing Eclipse (Java)
[jOOQ] How to CASE WHEN in the WHERE / AND / OR clause
Avoid character code error in java when using VScode extension RUN-CODE
How to get the length of an audio file in java
Unknown error in line 1 of pom.xml when using Spring Boot in Eclipse
How to increment the value of Map in one line in Java
[Rails 5] How to display the password change screen when using devise
How to write the view when Vue is introduced in Rails?
How to solve the problem that line breaks in cells are amplified when outputting EXCEL using SXSSF Workbook (3.16 or older)
How to implement Kalman filter in Java
[Rails] What to do when the error No database selected and Unknown database appears in db: migrate
Try to solve Project Euler in Java
[Java] How to use the File class
Java reference to understand in the figure
[Java] How to use the hasNext function
How to put out the error bundling
Try using the Stream API in Java
[Java] How to use the HashMap class
[Java] How to calculate age using LocalDate
[Java] How to use the toString () method
Studying how to use the constructor (java)
[Processing × Java] How to use the loop
[Java] How to get the current directory
How to embed Janus Graph in Java
[Processing × Java] How to use the class
How to install the legacy version [Java]
[Java] How to use the Calendar class
How to display error messages in Japanese
I summarized the points to note when using resources and resources in combination
What to do and how to install when an error occurs in DXRuby 1.4.7
[Java] How to get to the front of a specific string using the String class
How to get the value after "_" in Windows batch like Java -version
How to constrain the action of the transition destination when not logged in
I want to get the IP address when connecting to Wi-Fi in Java
I want to display an error message when registering in the database
How to pass a proxy when throwing REST over SSL in Java
How to get the absolute path of a directory running in Java
[Swift] How to set an image in the background without using UIImageView.