I need to patch an old version of some Java software. The problem is that reconstructing the whole package at the old version would be very difficult because it is a very complex program.
I have the corrected source file. Is there any way to compile just this one file to a class file and then insert it into the jar, or do I have to have every single source file?
UPDATE - How to do a Java Patch
Using Elliott Frisch's answer I was able to make the patch. Here is the command line:
javac -target 1.5 -source 1.5 -cp original.jar;otherlib.jar CorrectedSource.java
So, to sum up. You specify the target version of Java and set the source to match, include the original jar (and any libs) as the classpath, then finally name the source code you want to compile. You can then take the resultant class files and insert them into the jar, replacing the old class files.