我在IntelliJ程序中遇到了以下错误信息:
SLF4J: 未能加载类 "org.slf4j.impl.StaticLoggerBinder"。
SLF4J: 默认将使用无操作(NOP)记录器实现
SLF4J: 有关详细信息,请参见http://www.slf4j.org/codes.html#StaticLoggerBinder。
功能:Shout
经过研究,看起来我缺少JAR文件,需要更新类路径等。 一些答案说要在Maven POM中添加依赖项,所以我已经这样做了,点击“构建”并重新运行带有相同结果的功能文件。 一些答案还说要添加jar文件,但我对Java IDE非常不熟悉,也不是开发人员。我搜索了如何添加jar文件,大多数答案告诉我去IntelliJ的项目结构。在项目结构的工件部分,我点击“+”,然后看到一个选项“从模块创建jar”,但这个弹出框非常令人困惑。我不知道该怎么做。我也下载了SLF4J jar文件,但我不知道如何将它们导入到IntellJ中。从模块创建JAR似乎没有与桌面的链接来导入任何东西。从空白创建jar会产生另一个屏幕,似乎没有任何与桌面的链接。其他结果说要从模块下的“+”符号添加jar文件,这也似乎没有任何选项。我也不确定这是多大的问题,因为运行我的功能文件会导致错误的输出,并且可能无论如何都存在此问题。
以下是我的POM:
经过研究,看起来我缺少JAR文件,需要更新类路径等。 一些答案说要在Maven POM中添加依赖项,所以我已经这样做了,点击“构建”并重新运行带有相同结果的功能文件。 一些答案还说要添加jar文件,但我对Java IDE非常不熟悉,也不是开发人员。我搜索了如何添加jar文件,大多数答案告诉我去IntelliJ的项目结构。在项目结构的工件部分,我点击“+”,然后看到一个选项“从模块创建jar”,但这个弹出框非常令人困惑。我不知道该怎么做。我也下载了SLF4J jar文件,但我不知道如何将它们导入到IntellJ中。从模块创建JAR似乎没有与桌面的链接来导入任何东西。从空白创建jar会产生另一个屏幕,似乎没有任何与桌面的链接。其他结果说要从模块下的“+”符号添加jar文件,这也似乎没有任何选项。我也不确定这是多大的问题,因为运行我的功能文件会导致错误的输出,并且可能无论如何都存在此问题。
以下是我的POM:
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cucumber-school</groupId>
<artifactId>shouty</artifactId>
<version>0.0.1</version>
<packaging>jar</packaging>
<name>Shouty</name>
<properties>
<java.version>1.8</java.version>
<junit.version>4.12</junit.version>
<cucumber.version>2.3.1</cucumber.version>
<cucumber.pro.version>2.0.4</cucumber.pro.version>
<maven.compiler.version>3.3</maven.compiler.version>
</properties>
<dependencies>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>pro-plugin</artifactId>
<version>${cucumber.pro.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.21</version>
</dependency>
</dependencies>