Search code examples
javaeclipsewarear

how to get java source code from war file?



I do not have the latest source code but have the war(up to date) file deployed on server.

Please suggest the best ways to
1) Retrieve source code from war/ear
2) Compare & Merge/update the available source code with the code present in war/ear but missing in available source code(I am using ECLIPSE IDE)

Thanks in advance


Solution

  • War files are basically zip files, so they are easy to extract. (using unzip or just renaming the file) Next you could use a Java decompiler like JD. But you won't get the original Java code as the compiler does a lot of optimization. But it should give you a good starting point