Bytecode not optimized

Hello.

Many decompilers can recover source code from bytecodes, but not always it is equal to original source code because the compilation process made several optimizations.

I’d like to control the compilation process for getting bytecode as closed as original source code (without optimizations for loops). Is it possible? Has javac an option to do that or there is another tool?

Regards.
ujuarez71Asked:
Who is Participating?
 
aozarovConnect With a Mentor Commented:
Sorry:
javac -g:lines,vars,source   ...
This put in the class as much information to ease the process of debugging and enable better matching of class->src
0
 
aozarovCommented:
Try:
javac -g:-g:lines,vars,source ...
0
 
ujuarez71Author Commented:
This works very well. Are lines,vars,source all the values for -g option?
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
aozarovCommented:
Yes.
To see it run javac without any arguments and you will get the list.
0
 
ujuarez71Author Commented:
Thank you!
0
 
aozarovCommented:
You are welcome :-)
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.