JarByteEditor is a Java 21 desktop and CLI tool for opening .jar / .zip files, inspecting JVM bytecode with ASM, editing .jasm text, editing resources, and packaging the result back into a jar.
mvn clean packageThe runnable jar is created at:
target/JarByteEditor.jarThe default JavaFX classifier is win. On another platform, build with:
mvn clean package -Djavafx.platform=linux
mvn clean package -Djavafx.platform=macjava -jar target/JarByteEditor.jarThe GUI provides:
- Modern, dark JavaFX layout powered by the AtlantaFX PrimerDark theme.
- Chrome-style Multi-Tab Editor: Open and edit multiple
.classor resource files simultaneously without losing state. Open JARfor.jarand.zip.- Dual-Mode Class Editing: View and edit classes in either
.jasmbytecode assembly or full Java source code (decompiled via CFR). - Live Java Compilation: Edit Java source code and recompile on the fly. The compiler automatically uses a
libsdirectory or custom JARs added viaProject > Manage Dependencies. - Editable text resources such as
yml,json,txt,xml, andproperties. - Binary metadata viewer with path, size, SHA1, and modified state.
- Lazy JAR loading with progress/cancel, safe large-file preview, class disassembly only after selection, and one-entry-at-a-time translation scanning to avoid GUI freezes on heavy archives.
- Save current editor buffer (compiles Java or assembles JASM) into the in-memory project with
Ctrl+S. - Save all modified tabs and export project with
Ctrl+Shift+S. - Save As JAR.
- Export Project with raw classes, resources,
.jasm, andproject.json. - Search, replace string, diff, statistics, call graph, annotation display, and constant pool table.
- Translate Project workflow with Google Translate preview, per-string checkboxes, and apply-to-memory changes.
Open a jar, then use:
Tools > Translate ProjectSelect source and target languages, for example English to Vietnamese. JarByteEditor scans text resources and class string constants, sends candidate strings to Google Translate, then shows a preview table:
- Tick rows you want to keep.
- Untick rows you do not want to apply.
- Click
Apply Selected. - Export with
File > Save As JAR.
JarByteEditor uses the Google Translate web domain, matching the browser flow:
https://translate.google.com.vn/?sl=en&tl=vi&op=translateInternally it requests the same Google Translate web service on translate.google.com.vn, without requiring a Cloud Translation API key.
The jar opens the GUI when no arguments are provided. With arguments it runs Picocli commands:
java -jar target/JarByteEditor.jar list plugin.jar
java -jar target/JarByteEditor.jar disasm plugin.jar output
java -jar target/JarByteEditor.jar asm output plugin-fixed.jar
java -jar target/JarByteEditor.jar replace-string input.jar old new output.jar
java -jar target/JarByteEditor.jar search plugin.jar "Hello"
java -jar target/JarByteEditor.jar stats plugin.jar
java -jar target/JarByteEditor.jar diff old.jar new.jar
java -jar target/JarByteEditor.jar callgraph plugin.jarCommands that rebuild classes accept a target Java version:
java -jar target/JarByteEditor.jar asm output plugin-fixed.jar --target 21
java -jar target/JarByteEditor.jar replace-string input.jar old new output.jar --target 17If --target is omitted, original class versions are preserved.
| Java | Class Version |
|---|---|
| 8 | 52 |
| 9 | 53 |
| 10 | 54 |
| 11 | 55 |
| 12 | 56 |
| 13 | 57 |
| 14 | 58 |
| 15 | 59 |
| 16 | 60 |
| 17 | 61 |
| 18 | 62 |
| 19 | 63 |
| 20 | 64 |
| 21 | 65 |
| 22 | 66 |
| 23 | 67 |
| 24 | 68 |
| 25 | 69 |
The editor uses a compact assembler format:
VERSION 61
CLASS public com/example/Main
SUPER java/lang/Object
FIELD private message Ljava/lang/String;
METHOD public onEnable ()V
ALOAD 0
LDC "Enabled"
RETURN
ENDSupported editable instruction families include no-argument opcodes, variable opcodes, integer opcodes, field calls, method calls, type instructions, jumps, labels, line numbers, LDC, IINC, and MULTIANEWARRAY. Classes with advanced instructions are still opened and exported; unchanged class bytes are preserved during exported-project assembly.
JarByteEditor provides two distinct modes for editing Java classes:
-
JASM (Bytecode Assembly): Class edits in JASM are handled with ASM and written with:
ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS
The loader keeps class metadata in ASM tree form, including signatures, modules, records, nests, permitted subclasses, annotations, inner classes, source attributes, bootstrap methods, and debug tables when the corresponding methods are not rewritten.
-
Java Mode: JarByteEditor integrates the CFR Decompiler to convert bytecode back into readable Java source. When editing in Java mode, pressing
Ctrl+Spasses the code to the standardjavax.tools.JavaCompiler. To preventClassNotFoundExceptionduring live compilation, JarByteEditor automatically adds.jarfiles from alibsdirectory adjacent to your target JAR, and allows you to manually attach extra dependencies via the Project > Manage Dependencies menu.
disasm and GUI export create:
project/
classes/
com/example/Main.class
com/example/Main.class.jasm
resources/
plugin.yml
project.jsonasm project plugin-fixed.jar rebuilds the jar. If a .jasm file has not changed, the original .class bytes are copied back exactly. If a .jasm file changed, the class is assembled through ASM.