Categories:
Audio (13)
Biotech (29)
Bytecode (22)
Database (79)
Framework (7)
Game (7)
General (497)
Graphics (53)
I/O (32)
IDE (2)
JAR Tools (70)
JavaBeans (16)
JDBC (86)
JDK (338)
JSP (20)
Logging (90)
Mail (54)
Messaging (8)
Network (106)
PDF (82)
Report (7)
Scripting (75)
Security (67)
Server (112)
Servlet (17)
SOAP (24)
Testing (55)
Web (24)
XML (287)
Other Resources:
Compiling Program with Log4j 2.4.1
How to compile my program with Log4j 2.4.1? My program uses Log4j 2 API only and I want to know which JAR file is needed to compile it.
✍: FYIcenter.com
If your program is using Log4j 2 API,
you need to compile the program with JDK 1.7 or higher
with only the Log4j 2 API JAR, like log4j-api-2.4.1.jar.
Here is a compilation session with the HelloLog4j2.java program:
fyicenter>java -version java version "1.7.0_45" Java(TM) SE Runtime Environment (build 1.7.0_45-b18) Java HotSpot(TM) Client VM (build 24.45-b08, mixed mode, sharing) fyicenter>javac HelloLog4j2.java HelloLog4j2.java:2: error: package org.apache.logging.log4j does not exist import org.apache.logging.log4j.*; ^ HelloLog4j2.java:4: error: cannot find symbol private static final Logger logger ^ symbol: class Logger location: class HelloLog4j2 HelloLog4j2.java:5: error: cannot find symbol = LogManager.getLogger("HelloLog4j2"); ^ symbol: variable LogManager location: class HelloLog4j2 3 errors fyicenter>javac -classpath \local\lib\log4j-api-2.4.1.jar HelloLog4j2.java
The above session shows that:
Back to FAQ for Apache Log4j 2.4.1.
2015-11-18, 1495👍, 0💬
Popular Posts:
Apache Axis2 is the core engine for Web services. It is a complete re-design and re-write of the wid...
Mailer Tag library, Release 1.1, is used to send e-mail. JAR File Size and Download Location: File n...
The Web Services Description Language for Java Toolkit (WSDL4J), Release 1.6.2, allows the creation,...
What Is mail.jar of JavaMail 1.4? I got the JAR file from javamail-1_4.zip. mail.jar in javamail-1_4...
The Jakarta-ORO Java classes are a set of text-processing Java classes that provide Perl5 compatible...