up vote 21 down vote favorite
2

It hasn't been updated since 2006. Are there better alternatives?

Homepage: http://www.kpdus.com/jad.html

flag
2  
The homepage is down. Here are other links. web.archive.org/web/20080214075546/http://… varaneckas.com/jad – Joshua Jun 26 '09 at 1:32

8 Answers

up vote 15 down vote

What about Java Decompiler? Seems to be more up-to date

link|flag
Java Decompiler and it's JD-GUI is better than DJ Java Decompiler – Jader Dias Jun 19 '09 at 16:50
up vote 8 down vote

Yes, DJ Java Decompiler is based on JAD as decompiling engine. But now it supports annotations and the new attributes in Java 1.5. It's much more powerful now.

link|flag
Yay! First to give you points! – Kieveli Jun 16 '09 at 14:25
up vote 6 down vote

Just a mention: "DJ Java Decompiler" is a windows-only GUI and taking Jad as its decompile engine.

Jad is 1.5.8g now and really awesome with its powerful commandline options and so many plugins on different Java-IDEs.

link|flag
up vote 3 down vote

Beware though, jad doesn't support Java 5 syntax (i.e., Generics) - but still handles .class files with generics pretty well.

So, if you want to decompile the .class file of the following example with jad

Map<String, Integer> map = new HashMap<String, Integer>();
map.put("one", Integer.valueOf(1));
System.out.println(1 == map.get("one"));

You'll end up with something like this:

Map map = new HashMap();
map.put("one", Integer.valueOf(1));
System.out.println(1 == ((Integer)map.get("one")).intValue());
link|flag
12  
Actually there is no way any decompiler can determine if generics are used since generics in java are implemented with type erasure. – hhafez Jun 13 '09 at 11:02
Actually, from the example given, you have more than enough data to infer the Generic Type from the inputs to the HashMap and the cast. The class also contains versioning information, so for v.5 above it would seem to be a given that Generics should be used. – _ande_turner_ Jun 16 '09 at 18:57
The example doesn't have enough data. The fact that put() is called with (string, int) doesn't mean that it's a map of string -> int` - it could just as well be a map of Object -> Object. – Pavel Minaev Oct 14 '09 at 16:25
Java erases generics at runtime. However at compile time, and in the bytecode you have information about generics so you could potentially extract generics information. – Alexandru Luchian Apr 10 at 15:08
up vote 2 down vote

I recommend: DJ Java Decompiler. It's free to try and costs $19.99 to purchase.

I've also heard good things about Cavaj, but never used it personally. It's freeware, so definitely worth a try.

link|flag
2  
Cavaj is just a graphical frontend to Jad. – Asgeir S. Nilsen Sep 19 '08 at 17:31
So is DJ Java Decompiler. – Quinn Taylor Sep 19 '09 at 2:30
up vote 0 down vote

I've used Jad a number of times to decompile java source and it's excellent. It also has a very cool eclipse plugin which makes it even better.

link|flag
up vote 0 down vote

Blockquote Actually, from the example given, you have more than enough data to infer the Generic Type from the inputs to the HashMap and the cast. The class also contains versioning information, so for v.5 above it would seem to be a given that Generics should be used. Blockquote

And what about custom generic classes? In what way they should be processed? IMHO, there are no feasible way to decompile java classes with generic syntax in common manner with present class metadata.

link|flag
up vote 0 down vote

There's also a tool called JadRetro (jadretro.sf.net) - a decompiler helper. To achieve better results (including for java 1.5+ classes) in decompilation, process the classes with JadRetro before decompiling them by Jad. (Of course, it won't make Jad produce source with generics.)

link|flag

Your Answer

get an OpenID
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.