How retrieve the java source code from .war file project

7,686 views
Skip to first unread message

Ashok Reddy G

unread,
May 27, 2011, 2:08:37 AM5/27/11
to indi...@googlegroups.com
Hello Java Developers,

I developed a Java Web project in Netbeans IDE, i deployed the .war in Tomcat web server.
It is working good. but the thing is I lost the source code of the project which I've done the project in netbeans,
i don't have backups also ..i have project .war file which i have deployed in tomcat.
now the thing is i want to do some enhancements in existing java/servlet files ...
if i extract the .war file will find only .class files but not java files.
can i know is there any possibility to get back the entire source code of the project using any free tools.
please don't recommend DJ compiler.
i want the source code (i have .war file of my project) exactly what i created/developed.....

Please suggest me ...



Best Regards,
Ashok Reddy.G
+91 9912111185

Akshar Kaul

unread,
May 27, 2011, 4:22:21 AM5/27/11
to indi...@googlegroups.com
i am sorry you wont be able to get the exact source code you developed.
but you can use some decompilers to convert class files back to java files.


---> Akshar Kaul <---



--
You received this message because you are subscribed to the Google Groups "IndiJava - India Java User Group & Java Community." group.
To post to this group, send email to indi...@googlegroups.com
To unsubscribe from this group, send email to indijava-u...@googlegroups.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.indijava.in - India Java User Group & Java Community.
http://groups.google.com/group/indijava/
 
Java Fresher Jobs : http://www.indijava.in/community/fresher-jobs
Quiz : http://www.indijava.in/community/QUIZ
Java News: http://www.indijava.in/community/java-news
Tutorials: http://www.indijava.in/community/tutorials
Forum http://www.indijava.in/community/forum
SCJP Resources : http://www.indijava.in/community/category/certifications/scjp
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Kevin

unread,
May 31, 2011, 3:26:02 AM5/31/11
to IndiJava - India Java User Group & Java Community.
Mr. Ashok Reddy

Source code is something that one should keep safely for you dont know
when you may need it later
The war file that you have got contains only the .class files.
For retrieving source code you should consider more about reverse
engineering i.e. to derive source code from executable code. Since
your class files are executable code, reverse engineering will
convert .class files to java files.
However as for now I cannot help you much on this topic because even I
too don't know much about reverse engineering.
Sorry for the disappointment but do remember that source code should
have its necessary back ups
You can consider a tiresome process of recreating the code again based
on the output you see in your project.
Thats all for now!

-- Kevin D' Souza

sreehari ps

unread,
May 31, 2011, 4:22:20 AM5/31/11
to indi...@googlegroups.com
Hi,

Try this decompiler

http://java.decompiler.free.fr/?q=jdgui

Regards
Hari


Icon Web Solutions

unread,
May 31, 2011, 5:05:32 AM5/31/11
to indi...@googlegroups.com, ashok...@gmail.com
Use JAD to recover your source code. Java Decompiler.


--
You received this message because you are subscribed to the Google Groups "IndiJava - India Java User Group & Java Community." group.
To post to this group, send email to indi...@googlegroups.com
To unsubscribe from this group, send email to indijava-u...@googlegroups.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.indijava.in - India Java User Group & Java Community.
http://groups.google.com/group/indijava/
 
Java Fresher Jobs : http://www.indijava.in/community/fresher-jobs
Quiz : http://www.indijava.in/community/QUIZ
Java News: http://www.indijava.in/community/java-news
Tutorials: http://www.indijava.in/community/tutorials
Forum http://www.indijava.in/community/forum
SCJP Resources : http://www.indijava.in/community/category/certifications/scjp
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



--
-----------------------------------------------------
Dinesh Chanchalani
~USA~ 718-408-4482
~India~ 99696-13412

www.IconWebSolutions.info
www.IconTraining.info
www.JavaIssues.com
www.RentProjector.in 


"The fundamental principle of economic activity is that no man you transact with will lose; then you shall not"
- Chanakya in Arthashastra

“Success seems to be connected with action. Successful people keep moving. They make mistakes, but they don’t quit” - Conrad Hilton

कदम निरंतर बढ़ते जिनके, श्रम जिनका अविराम है,
विजय सुनिश्चित होती उनकी, घोषित यह परिणाम है |

Ashok Reddy G

unread,
May 31, 2011, 7:30:51 AM5/31/11
to indi...@googlegroups.com
Thank you very much ...


Best Regards,
Ashok Reddy.G
+91 9912111185



Kevin

unread,
May 31, 2011, 8:18:15 AM5/31/11
to IndiJava - India Java User Group & Java Community.
Great Idea to use a Decompiler!
I got to learn something new today.
Cheers to you all!

On May 31, 4:30 pm, Ashok Reddy G <ashokred...@gmail.com> wrote:
> Thank you very much ...
>
> Best Regards,
> Ashok Reddy.G
> +91 9912111185
>
> On 31 May 2011 13:52, sreehari ps <sreehar...@gmail.com> wrote:
>
> > Hi,
>
> > Try this decompiler
>
> >http://java.decompiler.free.fr/?q=jdgui
>
> > Regards
> > Hari
>
> >>http://www.indijava.in-  India Java User Group & Java Community.
> >> Forumhttp://www.indijava.in/community/forum
> >> SCJP Resources :
> >>http://www.indijava.in/community/category/certifications/scjp
>
> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "IndiJava - India Java User Group & Java Community." group.
> > To post to this group, send email to indi...@googlegroups.com
> > To unsubscribe from this group, send email to
> > indijava-u...@googlegroups.com
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >http://www.indijava.in- India Java User Group & Java Community.
> > Forumhttp://www.indijava.in/community/forum

vishwas m

unread,
Jun 1, 2011, 5:57:34 AM6/1/11
to indi...@googlegroups.com
 ya its really good to know,,!!!

 thank u guys,,!!! 
 Vishwas M
 

http://www.indijava.in -  India Java User Group & Java Community.

debasish rout

unread,
Jun 4, 2011, 11:17:02 AM6/4/11
to indi...@googlegroups.com, ashok...@gmail.com
Hi
To get the source file out of the war file first you need to:

1. Extract .class files from the .war file using jar tool or any zip tool
   jar -xf <jar file name>
2. use any Java decompilers like DJ Decompiler or Cavaj ro decompile the class files
   to java files.

Regards
Debasish Rout
S/W Engineer,
Discoverture Solutions
Bhubaneswar.


--
You received this message because you are subscribed to the Google Groups "IndiJava - India Java User Group & Java Community." group.
To post to this group, send email to indi...@googlegroups.com
To unsubscribe from this group, send email to indijava-u...@googlegroups.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.indijava.in - India Java User Group & Java Community.
http://groups.google.com/group/indijava/
 
Java Fresher Jobs : http://www.indijava.in/community/fresher-jobs
Quiz : http://www.indijava.in/community/QUIZ
Java News: http://www.indijava.in/community/java-news
Tutorials: http://www.indijava.in/community/tutorials
Forum http://www.indijava.in/community/forum
SCJP Resources : http://www.indijava.in/community/category/certifications/scjp
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



--
Debasish Rout
Reply all
Reply to author
Forward
0 new messages