How to view source code from .jar file using RAD 6 ?

Hi,

I have a jar file and I want to be able to view the souce code using RAD 6.
How can I do that?

I know that I need a decompiler to view the source from a jar file, right?

Doesn't RAD have any decompiler integraded with it?

If not what should I do to view the source from a jar file?


Thax.
_Esam.
_EsamAsked:
Who is Participating?
 
Gibu GeorgeChief Technology OfficerCommented:
Hello _Esam,

You need to extract the class files from the .jar file using jar -xvf <jarfilename>, and need to decompile each of the class files to see the code, you can use DJ Java Decompiler to decompile the class files. I am not sure whether RAD 6 has any decompiler coming with it

Regards,

gibu_george
0
 
_EsamAuthor Commented:
I know I can unjar the jar file using jar -xvf jarfilename.jar but I needed to know how can I set up RAD with a decompiler plug in if RAD doesn't have it already ???
How can I attach a plug-in for decompiler for RAD (it's just eclipse at core ?)..

Thax.
_Esam...
0
 
bpmurrayCommented:
First, to integrate the JAD decompiler, you can follow the instructions here: http://www.devx.com/Java/Article/22657

However, you may not have to do this. RAD already has source for many of the jars it ships with, so if you include the JAR in your build path, it'll appear in your project, and you can expand the jar , doublie-click on the class name and it'll pop up as source in teh Java editor. You can also explicitly associate source with a jar, and it'll react similarly.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
_EsamAuthor Commented:
I tried the above link already and it does't work ... the way it was suggested..because...
For Eclipse\plugins  ... I have multiple Eclipse\plugins  folders .. where do I really place it?


The second ...
Double clicking the .class from the explorer doesn't open the source...
It complains... Source not found !!!

That's why I needed the JAD decompiler ..

Thax.
_Esam.
0
 
bpmurrayCommented:
I'm using RAD 7, so I have a different directory structure to you. However, I'm pretty sure there's an eclipse\plugins directory under the installation directory. If you go to the JADClipse wiki at http://jadclipse.sourceforge.net/wiki/index.php/Main_Page, it'll give you some more instructions.
0
 
_EsamAuthor Commented:
How do I do:

eclipse -clean

if I am using Win XP?

Thax.
_Esam.
0
 
_EsamAuthor Commented:
RAD is pain...
I did use JAD with simple eclipse earlier and it worked fine...
0
 
hemsakbCommented:
To browse the source of a type contained in library you can attach a source archive or source folder to this library. The editor will then show the source instead of a the decompiled code. Having the source attachment set the debugger can offer source level stepping in this type.

The Source Attachment dialog can be reached in several ways:

Select a JAR in the Package Explorer and choose Properties > Java Source Attachment from the context menu or the Project menu
Open the Java Build Path page of a project (Projects > Properties > Java Build Path). On the Libraries page expand the library's node and select the Source attachment attribute and press Edit
Open an editor on a class file. If the source attachment has not already been configured for this JAR, the editor contains a button Attach Source
Depending of how a JAR was contributed to the classpath, you can see different types of Source attachment dialogs:
0
 
bpmurrayCommented:
You shouldn'e have to do eclipse -clean. However, if you go to your installation directory, in a DOS box, and ype "eclipse -clean" and then exit, it'll have reset the cache.
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.