JAR files are only ZIP files. Use a tool such as WinZip to extract all files from the JAR, replace the .class file with your own, recreate the ZIP file, for example, WinZip, rename it to .jar, overwrite the original JAR file.
If you do not have the source source in the .class file, you need to fix it and then use the Java decompiler to create the .java source for the class. There are no comments in the original, etc., But this is enough to correct errors (for example, incorrect check of zero, since several products are used in some products).
source share