r/javahelp • • Feb 23 '22

Bytecode editor?

I'm aware that class files are a binary format but I want to be able to edit class files and have the corresponding bytecode generated for me. So basically just open up a jar and edit a ClassFile and have the jar updated to match. Does such a tool exist?

0 Upvotes

8 comments sorted by

View all comments

1

u/ATE47 Intermediate Brewer Feb 23 '22

Usually we decompile the classes and we recompile them with the needed update. You have Fernflower as a CLI, but it’s also implemented in many IDE

-2

u/Mysterious-Trick-562 Feb 23 '22

I don't want to edit decompiled java. Do you know of any tool that lets you edit the bytecode directly? Kind of like what ASM does but in an editor

1

u/ATE47 Intermediate Brewer Feb 23 '22

You can use javap to disassemble the bytecode, then I found this, it should be able to reassemble the bytecode : https://github.com/raptor494/jvm-bytecode-reassembler

1

u/Mysterious-Trick-562 Feb 23 '22

That looks useful. Thanks