what software can help me to unwar a war file and get the java source code within it?

StackOverflow https://stackoverflow.com/questions/1382991

  •  21-09-2019
  •  | 
  •  

Question

what software can help me to unwar a war file and get the java source code within it ?

Was it helpful?

Solution

I like http://www.rarlab.com/ WinRar for my XP. You can even search the war for certain class names, files containing certain text, etc.

OTHER TIPS

Use a normal zip utility like 7zip to open the war file and extract the content and use jd-gui to decompile the classes

If you want to do it programaticly, do the following:

  • Use java.util.zip.ZipInputStream to read the war file. See Sun Compression
  • Once the file is "unzipped". Write a class that will browse the directory tree of the unzipped archive.
  • Then use a java.io.FilenameFilter that only returns .java files. File.listFiles, See List Files

  • Licensed under: CC-BY-SA with attribution
    Not affiliated with StackOverflow
    scroll top