wood burning stoves 2.0*
The moose likes Java in General and the fly likes Tip: Decompile Class With A Right Click Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Tip: Decompile Class With A Right Click" Watch "Tip: Decompile Class With A Right Click" New topic

Tip: Decompile Class With A Right Click

Patrick Kent

Joined: Aug 05, 2008
Posts: 2
This took me a bit of experimentation to figure out, so I thought I'd save y'all the time by posting it. This tip shows you how to put a decompiler in your Windows Send To menu. Once that is done you can just right click on any class, select Send To, and select Decompile.

Let's forego the controversy about decompiling. Let's say you have a legitimate reason, are not stealing code, and have permission to decompile whatever it is.

First, you'll need JAD (http://www.kpdus.com/jad.html).

Install it where ever you want. I have mine in c:\java\.

Go to your Send To folder in your windows profile. Create a new file there called "Decompile.bat".

Edit the file and paste this in:

You're done, enjoy.

[ August 06, 2008: Message edited by: Patrick Kent ]
[ August 06, 2008: Message edited by: Patrick Kent ]
Sumit Bisht
Ranch Hand

Joined: Jul 02, 2008
Posts: 329

Hi Patrick!
The JAD decompiler also comes bundled(?) with Gel-a light window executable based ide.

I am not so sure whether this works correctly as sometimes I've ended up with methods without any code in between .
(I did this to see a business method implementation in a Session Bean,after it was unjarred)
Nitesh Kant

Joined: Feb 25, 2007
Posts: 1638

I use cavaj
You can just double-click on the class file!!!

apigee, a better way to API!
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 685
In windows double click means to open a file with a default commandline. That information is stored in the registry.
Does the install of Cavaj change your registry to make it the default for .class files? What if you already have a default and don't want to change it?
Will it destroy your existing registry entries for .class files?
Does it ask you permission to change your registry?
I'd be careful installing a program that makes changes to your registry.

I have several context menu choices for .class files that appear when I RC on a class file.
Patrick Kent

Joined: Aug 05, 2008
Posts: 2
I too enjoy having several contextual options for a given file type.

Here's another batch script for your Send To menu. This one decompiles a whole jar file.

I agree. Here's the link: http://aspose.com/file-tools
subject: Tip: Decompile Class With A Right Click
Similar Threads
how to load a class file during startup
Error Message Exception thread "main" Java.lang.NoClassdef Found Error Hello...?
Using Java Virtual Machine
Command Prompt ?