• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

"patching a jar" - right term?

 
Ranch Hand
Posts: 127
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Any suggestions?
 
Marshal
Posts: 25594
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 3111
459
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe Updating a JAR File is a more common name for the process of modifying the contents of a jar file?
 
Bob Winter
Ranch Hand
Posts: 127
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Saloon Keeper
Posts: 22112
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bob Winter
Ranch Hand
Posts: 127
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Tim
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!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic