So, one may can guess from the topic: I came accross the term "patching a jar" in a conversation. As I myself never heared or used that term to describe a modification of a jar I replied: "nah, not the term used in Java conventions" - but got the reply "yes, it is". As I don't want to start an argue with the other person (although I neither don't know him long nor well) I do respect him and his work he pulled off in a short amount of time. So, maybe it's just me not used to that term or its use in that case - hence I'm asking here:
Does anyone of you use the term "to patch a jar" when it's about modifying it's content (with most likely something like 7zip or winrar, I guess?)?
I would had just used the term: "I had to modify the jar" or something similar - but "patching a jar" - first time I ever heared it used this way.
I don't think that's the standard usage in the Java world, but that's mostly because Java developers don't do that very much. At least I don't think they do, I have to admit I'm out of touch with large-scale Java environments. But "patching" is a normal word for modifying software in a cheesy low-level sort of way like that, so I wouldn't be surprised to hear Java developers using it.
Maybe Updating a JAR File is a more common name for the process of modifying the contents of a jar file?
posted 1 week ago
Ron McLeod wrote:Maybe Updating a JAR File is a more common name for the process of modifying the contents of a jar file?
Well, that would be something I would use - at least rather than "patching" a jar.
As said: I don't know much about the other person - only he's rather young but from what I've seen rather talented (compared to me at that age when I just got a dev book about java in my hands for the first time). He used this term for modifying the main game jar of minecraft to alter some launch behaviour which the game itself doesn't do the way he wants to - and referred to that modifying as "patching the main jar of MC".
As for using "update a jar" - well, aside from that's the term when using the jar tool to tinker with those files, I would use that term while developing and actually updating the jar with a new class I just modified and recompiled. As said: I suspect he just used 7zip or winrar (as a jar is in fact just a zip file) instead of jar or some gui provided by some gui - so, in respect to what Paul suggested, I guess it fits that he used that term - as he "cheesy low-level modified the game".
Anyway, nevermind, thanks for the input.
Back in ancient times, code wasn't optimized much and compilation/link time was very slow, so it was often more convenient to "zap" bytes of program code to fix faults. Which also helped if a memory dump was later needed, since the rest of the code was still in the same place and you could use an old printout as reference.
But that particular trick became virtually extinct when optimizing compilers began to be the norm (patching works best on assembly language and worst when code gets moved around a lot by optimizers), and time spent running the compile-and-link stages was no longer significant.
Patching source code - where you insert/remove/update lines of source text - is still very much alive and well. The reason that the same master source code can run on BSD Unix, 17 flavors of Linux and MacOS is that the package creation process for most of those platforms starts by pulling the universal master source code and patching it with OS/distro-related adjustments.
You can't do that kind of stuff with a JAR. The contents are compressed, for one thing, and compression is extremely dependent on what is being compressed, so technically, all you can do is update JAR members, not literally "patch" inside the JAR.
But it's not like there can be a lot of confusion, so I wouldn't argue the point. Except to note that good Java practice is to avoid multiple similar-but-not-identical JARs by encoding a version number that uniquely identifies a given version of a jar, regardless of whether you built it from scratch or "patched" an earlier version.
"privilege" comes from the Latin words for "private" and "law" (legal) and dates to feudal times. To "claim privilege" meant that you were above the laws that applied to the common people.
posted 1 week ago
Very informative explanation. Thank you sir.
Your mind is under my control .... your will is now mine .... read this tiny ad
Devious Experiments for a Truly Passive Greenhouse!