Is there a java classfile / bytecode editor to edit instructions?

MRalwasser picture MRalwasser · Jul 22, 2010 · Viewed 27.3k times · Source

Is there a utility (or eclipse plugin) for editing java class files? I'd like to manipulate the bytecode of a java class file without recompiling it nor having a complete buildpath.

E.g. to rename methods, add/delete instructions, change constants etc.

The only utilities I found are:

  • classeditor but it's very limited in functionality (e.g. renaming of things and manipulating instructions isn't possible).

  • jbe doesn't save changes (maybe because class verifying fails - before I made any changes, although the class runs perfectly)

    (jbe initially had a classpath issue, adding the class path to the jbe.bat file helped)

Answer

nahsra picture nahsra · Jan 29, 2011

I use reJ for editing class files directly.

It allows you to edit instructions, methods, constant pool, diff classes, and a split view with a hex editor.

It's ridiculously awesome.