我遇到了 Java 9b78 问题。预计会出现这样的错误,但这也是 b68 中的问题。
我想我会使用 Java 9 并尝试在其上玩 minecraft 以提高 Java 的性能。我收到以下堆栈跟踪消息:
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/management/internal/GarbageCollectorExtImpl
at sun.management.MemoryImpl.getMemoryManagers0(Native Method)
at sun.management.MemoryImpl.getMemoryManagers(MemoryImpl.java:98)
at sun.management.ManagementFactoryHelper.getGarbageCollectorMXBeans(ManagementFactoryHelper.java:130)
at java.lang.management.DefaultPlatformMBeanProvider$4.nameToMBeanMap(DefaultPlatformMBeanProvider.java:185)
at java.lang.management.ManagementFactory.lambda$getPlatformMBeanServer$0(ManagementFactory.java:478)
at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:269)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1664)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:430)
at java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:479)
at org.apache.logging.log4j.core.jmx.Server.registerMBeans(Server.java:107)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.<init>(Log4jContextFactory.java:59)
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:425)
at java.lang.Class.newInstance(Class.java:465)
at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:85)
at azo.<clinit>(SourceFile:200)
at net.minecraft.client.main.Main.main(SourceFile:42)
显然,Minecraft 并不是唯一遇到此错误的程序:https ://josm.openstreetmap.de/ticket/11577