Subclassing sun.* class in same package gives IllegalAccessError

戏子无情 提交于 2019-12-05 06:27:05

SourceChannelImpl is a "package private" class. In the JVM a package is always loaded by a single class loader. If you have two packages with the same name loaded by different class loaders, they are not the same package.

You can fix this by loading some or all of your code in the bootstrap class loader with -Xbootclasspath/a:mybootspath.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!