Search code examples
javaintellij-ideabytecodedecompiling

In IntelliJ, is there a way to modify the decompiled class in the bytecode viewer?


By default, the bytecode viewer is in read-only mode.

Is there a way to modify the code and save to a new class file?


Solution

  • There is a plug-in called Bytecode Editor:

    Provides View | Edit Bytecode action for those who learns JVM internals.

    Based on ByteCode Viewer by JetBrains but is better:

    • it uses an editor tab instead of a popup
    • it allows you to edit bytecode assembler and assemble edited code back into .class files
    • it provides default hotkey for bytecode analysis: Ctrl+K, Ctrl+B