Anything is fine, so I'll try using the library.
Get the library file. This time I will use slf4j, which is famous for log operations.
Download the jar file from slf4j-api-1.7.25.jar at here.
Right-click the target project in Eclipse and open "Add External Archive" in "Build Path".
Select the target library and open "Build Path Configuration" under "Build Path".
Click "Apply and Close".
Write the code for execution.
package test1;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Test1 {
public static void main(String[] args) {
Logger logger = LoggerFactory.getLogger("testLoger");
logger.info("test");
//TODO auto-generated method stub
System.out.println("Hello World");
}
}
When I ran it, I got an error, though it has nothing to do with the main story. Apparently, "slf4j-simple-1.7.25.jar" is also required, so I downloaded the jar and added it to the build path as well.
When I ran it again, it ran normally.
Now that I know how to use the library, I would like to continue using it.
Recommended Posts