views:

176

answers:

6

Hi, How to get java file i.e source code from class file i.e from compiled file?

A: 

You can make use of javap for getting the source back from bytecode.

There are plenty of tools and plugin that help you to disassemble and you can find some discussed here.

codaddict
+2  A: 

You have to use a disassembler.

Java Decompiler is a good choice.

Also Java Decompiler has a plug-in for Eclipse.

Upul
+1  A: 

You can use javap command to get the overall structure of the file.

On the side note: Best way to disable anyone from getting the source from your compiled code is to use obfuscation.

Chandra Mohan
+5  A: 

Check out this Java Decompiler.

Also see this Wikipedia page to know more about decompilation.

It should be noted that the code you get on decompilation of bytecode isn't very readable.

missingfaktor
+4  A: 

Check this link : http://java.decompiler.free.fr/

Another one : http://www.varaneckas.com/jad

Undefined
A: 

yes you can not do anything like reverse conversion

what u can do it u can modify the bytecode at runtime.. thats allowed in java...

check for java.lang.instrumentation package in java.. that will help u to achieve ur goal to some extent...

Mew 3.2