Verifying .java and .class files match

I have a bit of a strange situation in a team-working environment where many developers copy code to a production server. None of this code is in a Version Control System and I have been given the task of getting it into one (I've chosen Subversion, but that isnt important)

The problem is, its not as simple as doing a full commit of the production server because developers may have copied edited .class files onto the server, but not copied edited .java (therefore the .java file is not the same as the .class file)

Because the server has hundreds (if not thousands) or java and class files, I cant just decompile each of the class files and manually see if they match the java files, so I'm asking, is there a tool that can verify a java file matches a class file of the same name in terms of version (or if not is there an easier way of doing it than the decompile method)?

Thanks in advance

[923 byte] By [el_chupanegrea] at [2007-11-26 16:19:47]
# 1

Years ago I had to do something very much like this...and now I'm trying to recall how we did it (and for that matter whether it worked)...and I'm having trouble recalling. Ah, that's what happens when you read forums out of insomnia.

Of course, you can do a baseline check by just checking the file timestamps.Also instead of decompiling the class files you can try re-compiling the source code, and then generating checksums on both class files to see if they're the same.

You might be able to use BCEL (http://jakarta.apache.org/bcel/) to extract some useful information out of the class files. As I recall I tried this but the data wasn't useful for this kind of project, but maybe I'm misremembering. It's worth looking into.

paulcwa at 2007-7-8 22:43:18 > top of Java-index,Archived Forums,Debugging Tools and Techniques...