IntelliJ IDEA Tips & Tricks #8: Automatically Decompile the .class File by Viewing It!

preview_player
Показать описание
Often, you may need to decompile a Java class file. There are many reasons for that:
* the corresponding source code for an API may not be available and you want to see how the implementation looks like
* you want to see what the compiler has done with the code (e.g., how a try-with-resources got translated by the compiler)
* debug the code because the code seem to be fine by the compiler seem to think / process the code differently.

In these scenarios, it's easy to "decompile" a ".class" file - just open it in the editor and you'll see the decompiled source code. Note that it is a read-only file - you can modify the source code directly and try recompiling it and run it.
Рекомендации по теме