reverse eng class?

N

nialltimpson

Is there any way to turn a .class file a
back into a .java file? in a moment of madness, I deleted the wrong one?/

Thank you if you can help
Niall
 
O

Oscar kind

nialltimpson said:
Is there any way to turn a .class file a
back into a .java file? in a moment of madness, I deleted the wrong one?/

There is jad, the java decompiler. I've used it occasionally, and I've
never encountered a non-obfuscated class it could not decompile.
 
J

Joona I Palaste

nialltimpson said:
Is there any way to turn a .class file a
back into a .java file? in a moment of madness, I deleted the wrong one?/

You're describing decompilation, better known as "hamburger back into
cow". Yes, it's possible to turn a class file back into Java source
code. With any luck, the source code will even produce a similar class
when compiled. What you *WON'T* get is your original source code. All
information not present in bytecode, like local variable names,
comments and indentation, is lost forever.

--
/-- Joona Palaste ([email protected]) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"You have moved your mouse, for these changes to take effect you must shut down
and restart your computer. Do you want to restart your computer now?"
- Karri Kalpio
 
A

Alun Harford

nialltimpson said:
Is there any way to turn a .class file a
back into a .java file? in a moment of madness, I deleted the wrong one?/

Thank you if you can help

It's far easier to undelete the file than decompile it.

Alun Harford
 
M

Mike Schilling

Joona I Palaste said:
You're describing decompilation, better known as "hamburger back into
cow". Yes, it's possible to turn a class file back into Java source
code. With any luck, the source code will even produce a similar class
when compiled. What you *WON'T* get is your original source code. All
information not present in bytecode, like local variable names,
comments and indentation, is lost forever.

Local variable names will be present if the .class file contains debugging
info.
 
J

Joona I Palaste

Local variable names will be present if the .class file contains debugging
info.

That's true, I forgot that. But comments and indentation still won't.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top