aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Reverse engineering  a war files in eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Reverse engineering  a war files in eclipse " Watch "Reverse engineering  a war files in eclipse " New topic
Author

Reverse engineering a war files in eclipse

Thennam Pandian
Ranch Hand

Joined: Oct 11, 2005
Posts: 163
Dear Friends,

i need to create java file from a war file .


can i use Eclipse ,studio Creator or Netbeans .......
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41816
    
  62
A war file is a web application, not a Java class. It contains many resources like HTML, JSP, CSS, JS, libraries, configuration data and properties as well as Java classes.

Technically a war file is a ZIP file, so it should be easy to get at its contents using any old unzip program.


Ping & DNS - my free Android networking tools app
Bharat Roy
Ranch Hand

Joined: Jul 01, 2004
Posts: 156
Do you want the source code or just the compiled classes? If the case is later than:

(1) Rename the war archive to jar.
(2) jar -xvf warFileName.jar

This will unpack the entire structure.

If you want the original source code then you should have some utility like Java Decompiler. But even then you will have to unpack it. The code will be cryptic though, due to optimizations that the compiler does.

Make sure you are not doing this "reverse engineering" on the copyrighted material.

HTH
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30510
    
150

Originally posted by Ankur Bhatt:
(1) Rename the war archive to jar.
(2) jar -xvf warFileName.jar

Note that the jar command (or your favorite unzipping program) can unzip war files too. So you could just do:
java -xvf wareFileName.war


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reverse engineering a war files in eclipse