Hanfei Sun
Hanfei Sun

Reputation: 47071

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?

Upvotes: 10

Views: 21006

Answers (1)

CrazyCoder
CrazyCoder

Reputation: 402433

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

Upvotes: 10

Related Questions