Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

log4j package does not exist

Tags:

java

maven

I'm running mvn install, getting below error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile 

error: package org.apache.log4j does not exist

In my project hierarchy I have log4j-1.2.15.jar added as a Referenced Libraries..not sure what I'm missing.

Part of POM file with log4j dependency (should I change the version to just say 1.2...or possible remove the scope below?):

    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>1.2.15</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>1.2.15</version>
    </dependency>
like image 285
raptor496 Avatar asked May 02 '26 06:05

raptor496


1 Answers

For log4j I only use this libraries:

<dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>1.2.17</version>
</dependency>
like image 125
Liz Lamperouge Avatar answered May 03 '26 21:05

Liz Lamperouge



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!