简体   繁体   English

rt.jar的内容是否会在不同的JVM供应商之间发生变化?

[英]Does the contents of rt.jar change across different JVM vendors?

I've inheirited support for a legacy web app which is directly using the **.internal.** apache xerces classes within the rt.jar. 我对传统的Web应用程序的支持是直接使用rt.jar中的**。internal。** apache xerces类。 I think the history is that this code (back in java1.4) used to explicitly use xerces and at some point when moving to java5 use of the xerces jar was dropped and those classes were referenced out of rt.jar as the internal equivalents. 我认为历史是这个代码(在java1.4中)用于显式使用xerces,并且在移动到java5时某些时候使用了xerces jar,并且这些类被引用作为内部等价物的rt.jar。

I'm trying to understand what the impact of running this project on various web containers will be (eg Websphere versus Tomcat etc). 我试图了解在各种Web容器上运行此项目的影响是什么(例如,Websphere与Tomcat等)。

  • Is rt.jar supplied by SUN or the JVM/JRE vendor? 是由SUN或JVM / JRE供应商提供的rt.jar?
  • Do alternate vendors continue to use xerces internally or are there other XML implementations? 备用供应商是否继续在内部使用xerces还是其他XML实现?

At some point (resource permitting) this code will need to be changed to use the standard java APIs, I was want to get a handle on how big a problem this might be. 在某些时候(资源允许),需要更改此代码以使用标准的Java API,我想知道这可能有多大问题。

Thanks, Rob 谢谢,罗布

Nowhere in the JVM Specification or the Java Language specification is the rt.jar even mentioned and all the *.internal.* packages are explicitly marked as not being part of the API. JVM规范或Java语言规范中没有任何地方甚至提到rt.jar ,所有*.internal.*包都明确标记为不属于API。

Therefore it's safe to assume that using any of those binds you pretty directly to the JVM vendor and implementation version. 因此,可以安全地假设使用任何这些都可以直接绑定到JVM供应商和实现版本。 Not only can different vendors use different XML parsers, but even within one vendor, you can easily run into an issue when they change the XML parser, the version of the XML parser or the package in which the XML parser is shipped. 不同的供应商不仅可以使用不同的XML解析器,而且即使在一个供应商中,当他们更改XML解析器,XML解析器的版本或XML解析器所在的包时,您也很容易遇到问题。

All of those are perfectly legal changes, since those packages are not API. 所有这些都是完全合法的变化,因为这些包不是API。

So unless you're fine with being bound to a small set of known-good JVMs you should definitely switch to using the standard APIs or at least use Xerces as an external dependencies and thus from the normal org.apache.xerces.* packages. 因此,除非你被绑定到一小组已知良好的JVM上,否则你应该切换到使用标准API,或者至少使用Xerces作为外部依赖,因此从普通的org.apache.xerces.*包中使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM