I am trying to build a simple java application in eclipse that uses log4j to make logs (I intend to export it as a jar file).
- Apache Jar Files
- Log4j 1.2.17 Jar Download
- Commons Logging Jar
- Org Apache Log4j Logger Jar Download Windows
Spigot says I'm using org.apache.logging.log4j.core.Logger but I'm importing another class. Discussion in 'Spigot Plugin Development' started by Alex0589, Mar 14, 2019 at 4:55 PM. Download apache-log4j-1.2.15.jar. Apache-log4j/apache-log4j-1.2.15.jar.zip( 357 k) The download jar file contains the following class files or Java source files.
But when I try to import org.apache.log4j.Logger in the java file, I get an error as follows
Apache Jar Files
Could someone please help me with this?
AmberAmber3 Answers
You can find the class 'org.apache.log4j.Logger' in the log4j-X.X.XX.jar
This jar must be included in your build path.
If you have a maven project you can just add a dependency
Otherwhise you have to download the jar and add the jar manually to your build path.
Not web project, I mean, in plain Java project, it don't know the import jar file automatically. It mean, as to your structure, having jar in lib folder is not enough. You need to add this jar under lib folder manually to your class path.
You can do manually like this:
Hope it help.
Log4j 1.2.17 Jar Download
You need to download log4j package from link given below
Commons Logging Jar
and then left click on your project logtestjava > properties > Java build path > classpath > add all jars of log4j package