gpt4 book ai didi

java - Gradle:无法实例化 SLF4J LoggerFactory 错误

转载 作者:行者123 更新时间:2023-12-01 18:22:00 24 4
gpt4 key购买 nike

正如我在标题中提到的,我本地上使用 Gradle 的项目开始抛出此错误:

This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the User Manual chapter on the daemon at https://docs.gradle.org/6.2/userguide/gradle_daemon.html
Process command line: /Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home/bin/java -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country=GB -Duser.language=en -Duser.variant -cp /Users/loaner/.gradle/wrapper/dists/gradle-6.2-bin/6xuflze0i9mjovrm0ys9asj72/gradle-6.2/lib/gradle-launcher-6.2.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 6.2
Please read the following process output to find out more:
-----------------------
Failed to instantiate SLF4J LoggerFactory
Reported exception:
java.lang.NoClassDefFoundError: ch/qos/logback/core/joran/spi/JoranException
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
at org.gradle.api.logging.Logging.getLogger(Logging.java:38)
at org.gradle.launcher.daemon.bootstrap.DaemonMain.<clinit>(DaemonMain.java:62)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:58)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
at org.gradle.launcher.daemon.bootstrap.GradleDaemon.main(GradleDaemon.java:22)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.core.joran.spi.JoranException
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 14 more
java.lang.ExceptionInInitializerError
at org.gradle.internal.classloader.ClassLoaderUtils.tryClose(ClassLoaderUtils.java:52)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:64)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
at org.gradle.launcher.daemon.bootstrap.GradleDaemon.main(GradleDaemon.java:22)
Caused by: java.lang.IllegalStateException: org.slf4j.LoggerFactory in failed state. Original exception was thrown EARLIER. See also http://www.slf4j.org/codes.html#unsuccessfulInit
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:422)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
at org.gradle.internal.concurrent.CompositeStoppable.<clinit>(CompositeStoppable.java:37)
... 4 more

-----------------------
Check the JVM arguments defined for the gradle process in:
- gradle.properties in project root directory

我不知道如何解决它。

到目前为止我已经尝试过的;

IntelliJ IDEA 2019.3.3(社区版)java版本“1.8.0_221”

最佳答案

这看起来您的 Gradle 安装无效。

假设您使用 Gradle 包装器,我将删除 $HOME/.gradle/wrapper/dists/gradle-<gradle-version> 的内容并再次尝试运行该项目。

如果您没有使用 Gradle 包装器,而是安装的版本,我会删除它并重新安装。

关于java - Gradle:无法实例化 SLF4J LoggerFactory 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60284216/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com