How do you drop JRE class replacements?

java.util.zip has known problems using its own memory, so I'm trying to use a replacement for a replacement called jazzlib. Unfortunately, as is typical of sourceforge projects, there is no documentation. If I add jar to my class path, then Java will fail and give me "forbidden package names" because it replaced java.util.zip. How to tell Java that this is what I want to do?

+3
source share
4 answers

Either add it to the load class path, or add it as an approved jar.

It might be better to use shadows to rename classes from protected packages and use them that way. The maven-shade plugin is handy if you are using maven.

+2
source

For the last source, see the CVS repository of the class path. On this page you will find source and binary versions of the code both in the net.sf.jazzlib namespaces and in java.util.zip.

Just use the name in the net.sf.jazzlib namespace to avoid conflicts.

+2
source

, JRE, arg -Xbootclasspath. .

+1

I would not install some random (undocumented) library replacement in my JRE, and, of course, I would not do this for a production system or application that I intended to provide to someone else. People who support production will (rightfully) have a fit if they are asked to do such things.

But if you really want it, the answers from @bmargulies and @akf are useful.

+1
source

Source: https://habr.com/ru/post/1745906/


All Articles