gpt4 book ai didi

java.lang.ClassNotFoundException 太阳.misc.GC

转载 作者:搜寻专家 更新时间:2023-10-30 21:27:16 26 4
gpt4 key购买 nike

版本 java :10.0.1 Tomcat :8.0.36Ubuntu:18.04(64 位)Eclipse:光子(64 位)

错误:当我运行 Tomcat 服务器时,我发现了以下错误。请不要告诉我尽可能降低版本,因为我喜欢使用最新技术。

    SEVERE: Failed to trigger creation of the GC Daemon thread during Tomcat start to prevent possible memory leaks. This is expected on non-Sun JVMs.
java.lang.ClassNotFoundException: sun.misc.GC
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:566)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:291)
at org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(JreMemoryLeakPreventionListener.java:286)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:394)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:99)
at org.apache.catalina.startup.Catalina.load(Catalina.java:580)
at org.apache.catalina.startup.Catalina.load(Catalina.java:603)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:310)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:484)

最佳答案

Tomcat 8 引用了 sun.misc.GC,它已在 Java 9 中被删除 - 因此您会收到错误。

Please don't tell me to decrease the version if possible, because I love to use latest technology.

我会告诉你做相反的事情!您应该使用 Tomcat 9,而不是 Tomcat 8。错误应该会消失。

关于java.lang.ClassNotFoundException 太阳.misc.GC,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51083715/

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