代码之家  ›  专栏  ›  技术社区  ›  Shantanu Rauthan

无法在Java中导入log4j类

  •  0
  • Shantanu Rauthan  · 技术社区  · 4 年前

    我正在开始使用log4j,我被困在了第一个问题上,即成功导入类并使其运行。

    我已经为log4j 1.2 api-2.14.1添加了外部JAR 但我无法导入这些类。

    This is my code with all the jars i have imported

    This is the exception i am getting after running the code

    编辑: 因此,我自己做了一些挖掘,并通过以下步骤对上述错误进行了分类:

    1. 通过右键单击转到项目属性。
    2. 转到“Java构建路径”。
    3. 转到库并选择JRE
    4. 编辑Exxecution Environment并将其设置为JRE 1.1
    0 回复  |  直到 4 年前
        1
  •  1
  •   Ryan    4 年前

    我看到您有log4j api,但也需要安装log4j core。