开发者

Limitations to modifying rt.jar

What are the limitations when modifying classes in rt.jar. I realize this is generally specific to the version and vendor of the JRE. I've found that Hotspot in the Sun 1.6 VM, for instance, doesn't like if you add fields to java.lang.Object as it has hard-coded assumptions about the size of Object. However, if I modify significant portions of the classes in rt.jar, I get spurious ClassNotFoundErrors at runtime for classes that are definitely in my jar. I've tried modifying rt.jar in place as well as superseding it with the various -Xbootclasspath parameters.

I don't really know where to look for documentation on this sort of thing, I can't find anyt开发者_如何学Pythonhing in the OpenJDK docs, for instance.


Have you considered using a byte code instrumentation library to achieve what you want? You could use ASM + java.lang.instrument, for JDK's greater than or equal to 5.0

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜