我很难在 IntelliJ 中使用 Gradle 配置 SLF4J。无论我做什么,我都会收到以下消息:
SLF4J:无法加载类“org.slf4j.impl.StaticLoggerBinder”。SLF4J:默认为无操作 (NOP) 记录器实现 SLF4J:有关更多详细信息,请参阅http://www.slf4j.org/codes.html#StaticLoggerBinder。
我正在尝试登录控制台并在测试特定文件夹中的文件后。任何帮助都会很棒。
build.gradle 文件:
plugins {
id 'java'
id 'org.openjfx.javafxplugin' version '0.0.8'
id 'application'
}
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
jcenter()
google()
}
dependencies {
compile group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.+'
testCompile group: 'junit', name: 'junit', version: '4.12'
compile group: 'org.apache.poi', name: 'poi', version: '4.+'
compile group: 'org.apache.poi', name: 'poi-ooxml', version: '4.+'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.+'
// compile group: 'ch.qos.logback', name: 'logback-classic', …Run Code Online (Sandbox Code Playgroud) 我试图从某个季度获得几个月。使用下面的代码,我成功地从 LocalDate.now() 实例中获取了当前季度的月份名称。
我如何从一个季度的字符串(例如“Q1”)中获得一个季度的月份?
int monthInt = Month.from(LocalDate.now()).firstMonthOfQuarter().getValue();
for (int j = 1; j <= 3; j++) { //for each month in quarter
System.out.println(Month.of(monthInt).name()); //January, February, March
monthInt++;
}
Run Code Online (Sandbox Code Playgroud)