Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

Can I get the source code from jar file?

Thread view: 
www - 19 Mar 2007 16:44 GMT
Hi,

I am running somebody's program. He gives me a script to run the program
and all the bunch of jar files the program needs. He didn't give me the
*.java file at all. I am wondering if I can get those *.java files from
all the *.jar files.

Thank you.
swing - 19 Mar 2007 16:54 GMT
> Hi,
>
[quoted text clipped - 4 lines]
>
> Thank you.

Extract those jar files using winwar or an other program.
The owner might have included the source files.
Andrew Thompson - 19 Mar 2007 17:07 GMT
..
> ...I am wondering if I can get those *.java files ..

What did the author say, when you asked them?

Andrew T.
scifluent@gmail.com - 19 Mar 2007 17:12 GMT
You can use command line calls to extract the contents as well.  See
the site below.

http://java.sun.com/docs/books/tutorial/deployment/jar/basicsindex.html

If the author chose to include the source files...the will be in
there...if not, you will just see class files.

> Hi,
>
[quoted text clipped - 4 lines]
>
> Thank you.
www - 19 Mar 2007 17:40 GMT
Thank you all. I checked with:

jar tf jarfilename.jar

It is all *.class files, not *.java files. So the author didn't include
*.java files when he created these jar files.
usenetuser@hotmail.co.uk - 19 Mar 2007 18:05 GMT
> Thank you all. I checked with:
>
> jar tf jarfilename.jar
>
> It is all *.class files, not *.java files. So the author didn't include
> *.java files when he created these jar files.

You could use something like JAD (along with FrontEnd Plus) to
decompile the .class files to .java files.  You won't get his
exact .java files (i.e. it won't include comments, for example) but as
near as you're going to get without the originals.... so long as he
hasn't obfuscated the original.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.