Couldnotinitializeclassio.netty.util.internal.Platfor...
- 开源代码
- 2025-08-24 13:51:01

异常信息:
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class io.netty.util.internal.PlatformDependent0
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.reflect.InaccessibleObjectException: Unable to make field long java.nio.Buffer.address accessible: module java.base does not "opens java.nio" to unnamed module @668bc3d5 [in thread "main"]
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
at io.netty.util.internal.PlatformDependent0$1.run(PlatformDependent0.java:69)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
at io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:64)
at io.netty.util.internal.PlatformDependent.getSystemClassLoader(PlatformDependent.java:939)
at io.netty.util.internal.PlatformDependent.isAndroid0(PlatformDependent.java:956)
at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:81)
... 13 more
处理方式:
方式一:
降低jdk版本,可以使用jdk8试试
方式二:升级netty版本
可以升级到4.1.97.Final试试
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.97.Final</version>
</dependency>
参考:知识星球 | 深度连接铁杆粉丝,运营高品质社群,知识变现的工具
Couldnotinitializeclassio.netty.util.internal.Platfor...由讯客互联开源代码栏目发布,感谢您对讯客互联的认可,以及对我们原创作品以及文章的青睐,非常欢迎各位朋友分享到个人网站或者朋友圈,但转载请说明文章出处“Couldnotinitializeclassio.netty.util.internal.Platfor...”