• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

find source code through Jar file.

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am a beginner java programmer and have been entrusted with learning our company's Java application. The architect of the application is not forthcoming in sharing information and so I need help in tracing the source code for the application. I know where the .jar files are stored but I don't know where the actual .java or .class files are stored.

In the .profile file, I see the classpaths set to various jar files. eg.

CLASSPATH=$PATH:/eaid01_apps/merc01/libs/tools/java/drivers/bin/eaiRun.jar

When I view this jar file with command "jar tf eaiRun.jar", it displays all the files under it. Onc such listing is as following:

citi/eai/EAI.class
citi/eai/Interface.class

I want to go to that specific directory on our file system which is storing these .class or.java file. From what I have learned about packages, I should find some folder called 'citi' ,'eai'.
However I am not able to find these folders anywhere on file system. Is there a way I can find where the actual souce code is by looking at the jar files.

Please help. Let me know if you need more information.
thanks,
Anand.
 
Ranch Hand
Posts: 937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you have eclipse open those class files in eclipse , you will see the source code. Even jbuilder also do that. Otherwise use Mocha. I do have that. Do a search in google if not i can send that.
 
Ranch Hand
Posts: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can also check the DJ Java Decompiler from here
http://members.fortunecity.com/neshkov/dj.html
 
Sheriff
Posts: 9103
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A jar file is like a zip file. Just because some class is in a jar file on the system does not mean that the source file is on the system.
 
Ajoy Sharma
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks everybody for your help. I will download these tools and go from there.
Also, I would ask the architect what development procedure he follows if he does not store the source code files on a UNIX system from where the actual application runs.

Thanks,
Anand.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Eclipse doesn't show source for class files without adding a plugin does it? We use the Jadclipse plugin found here: http://sourceforge.net/docman/display_doc.php?docid=16915&group_id=40205

Keep digging for source access. If you have a lot of jars and a lot of class files you might write a little program to open a jar file, read the directory and write a report with package name, class name and jar name. Let the uncooperative architect see you using the report, but don't give him one. Heh heh heh.
[ July 02, 2004: Message edited by: Stan James ]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic