简体   繁体   English

在jre中更新gzip库

[英]Updating gzip library in jre

Is there a way to update gzip library that JRE uses? 有没有办法更新JRE使用的gzip库?

There is a bug in gzip library that is used by latest JRE, and it has been fixed in later version of gzip library, so I would like to make latest JRE work by updating just gzip. 最新的JRE使用的gzip库中有一个错误,并且已在更高版本的gzip库中修复,因此我想通过仅更新gzip来使最新的JRE工作。

Bug is in a native code from gzip library that JRE uses. Bug在JRE使用的gzip库的本机代码中。

Basically no (but you can probably do operating system magic to override the native library loader to include the new one). 基本上没有(但是您可能可以做一些操作系统魔术来覆盖本机库加载器以包括新的库加载器)。

Have you located this issue in the Java Bug Database? 您是否已在Java Bug数据库中找到此问题? http://bugs.sun.com/ http://bugs.sun.com/

I think it's possible by setting the bootclasspath: http://java.sun.com/javase/6/docs/technotes/tools/solaris/java.html to override the class with the newer version. 我认为可以通过设置bootclasspath来实现: http : //java.sun.com/javase/6/docs/technotes/tools/solaris/java.html用较新的版本覆盖该类。

Please read the warning: "Applications that use this option for the purpose of overriding a class in rt.jar should not be deployed as doing so would contravene the Java 2 Runtime Environment binary code license." 请阅读警告:“不应部署出于覆盖rt.jar中的类而使用此选项的应用程序,因为这样做会违反Java 2 Runtime Environment二进制代码许可证。”

(Or if the bug is located in a native library, you could use java.library.path) (或者,如果该错误位于本机库中,则可以使用java.library.path)

The short and simple answer is "no". 简短而简单的答案是“否”。 At least you would not want to go there for all sorts of reasons. 至少出于各种原因,您都不想去那里。

Unfortunately Commons Compress also only uses the native compressor from java.util.zip but in your case I would still use Commons Compress so the compressor becomes easy to replace from the API point of view. 不幸的是, Commons Compress也仅使用java.util.zip中的本机压缩器,但在您的情况下,我仍将使用Commons Compress,因此从API的角度来看,该压缩器变得易于替换。 Then write your own Compressor. 然后编写自己的Compressor。 In java if you don't need the speed or using JNI if want to really go for it. 在Java中,如果您不需要速度,则使用JNI,如果您真的想要它。 As soon as the bug is fixed in the JRE you can just switch the implementation back to the JRE one. 在JRE中修复错误后,您只需将实现切换回JRE。

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

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