Java Decompiler
Java Decompiler is a Visual Studio Code extension by DZH International Pte. Ltd. that lets you quickly decompile Java JAR and CLASS files locally using the bundled CFR Java decompiler (cfr-0.152.jar
).
Publisher: DZH International
Features
Quick Start
- Set
decom.output.path
in VS Code settings to a writable folder.
- Right-click any
.jar
or .class
file in the Explorer and select the decompile action.
- Or use the Command Palette: run
Decompile JAR with CFR
or Decompile CLASS with CFR
.
- Decompiled files will appear in your configured output directory.
- Decompile
.jar
archives to Java source (opens the output folder in a new VS Code window).
- Decompile individual
.class
files (opens the first produced .java
file automatically).
- Right‑click Explorer / editor title context menu action: decompile a selected
.jar
or .class
directly (skips file picker).
- Uses a timestamped subfolder under your configured output directory (keeps results separated and reproducible).
- Choice of system Java or a custom JDK path (
decom.java.jdk.home
).
- Completely local execution – no uploaded code, no telemetry.
- Automatic decompilation when opening or dragging
.class
/ .jar
files (configurable; default enabled for both) with cancel, size prompt, and debounce controls.
Requirements
- A Java runtime (JRE/JDK 8+). You can override the Java used via
decom.java.jdk.home
.
- The bundled CFR JAR (
resource/cfr-0.152.jar
) ships with the extension (see Third‑Party section). If you replace it with a newer version, keep the same filename or update the code.
- You must set an output directory via
decom.output.path
; otherwise the commands will abort with a warning.
Usage
- Open VS Code Settings and set:
decom.output.path
→ a writable folder (required)
decom.java.jdk.home
→ (optional) absolute path to a JDK install
- Open the Command Palette (
Ctrl+Shift+P
).
- (Option A) Right‑click a
.jar
or .class
file in the Explorer and choose the decompile action.
- (Option B) Open the Command Palette and run:
Decompile JAR with CFR
or Decompile CLASS with CFR
, then pick the file when prompted.
- Wait for the progress notification – output goes into:
- JAR:
OUTPUT_PATH/<timestamp>/<jarName>/
- CLASS:
OUTPUT_PATH/<timestamp>/
- For JARs: the output folder is opened in a new VS Code window (unless you disable it via
decom.jar.openFolder=false
). For single CLASS: first generated .java
file pops open.
Drag & drop: With the default settings, simply dragging a .class
or .jar
into VS Code will trigger automatic decompilation.
Note: Commands now explicitly reference CFR.
Updating the CFR Decompiler (Optional)
The extension bundles cfr-0.152.jar
. To upgrade:
- Download a newer CFR JAR from: https://www.benf.org/other/cfr/
- Replace the file in
resource/
with the downloaded version.
- Rename it back to
cfr-0.152.jar
or adjust the path in src/extension.ts
(variable cfrJar
).
- Rebuild / repackage the extension (
npm run compile
then npx vsce package
).
Configuration
You must configure the output directory for decompiled files by setting the decom.output.path
option in your VS Code settings. If this is not set, decompilation will not proceed.
Example:
{
"decom.output.path": "C:/Users/YourName/DecompiledJava"
}
You can also configure which JDK is used for decompilation by setting the decom.java.jdk.home
option. If set, the extension will use the java
executable from this path; otherwise, it will use the system default Java.
Example:
{
"decom.java.jdk.home": "C:/Program Files/Java/jdk-17"
}
This is useful if you need to use a newer JDK than the system default, or if you have multiple JDKs installed.
JAR Folder Auto-Open Control
You can disable the automatic opening of the decompiled JAR output folder by setting:
{
"decom.jar.openFolder": false
}
When disabled, a notification with the output path is shown instead.
Automatic Decompile on Open
The extension can automatically decompile .class
and/or .jar
files when they are opened (including via drag & drop). Controlled by:
decom.autoDecompile.mode
(default: both
)
Value |
Behavior |
off |
No automatic decompile. Use commands manually. |
class |
Only auto-decompile .class files. |
jar |
Only auto-decompile .jar files. |
both |
Auto-decompile both .class and .jar files. |
Disable completely:
{
"decom.autoDecompile.mode": "off"
}
Limit to classes only:
{
"decom.autoDecompile.mode": "class"
}
Auto-Decompile Advanced Settings
Additional settings controlling the automatic process:
Setting |
Default |
Description |
decom.autoDecompile.closeOriginal |
true |
Closes the initially opened binary editor to avoid showing raw bytes. |
decom.autoDecompile.debounceMs |
1000 |
Minimum milliseconds between auto-decompiles of the same file path. |
decom.autoDecompile.promptJarLargerThanMB |
50 |
If JAR size (MB) exceeds this, prompts before decompiling. Set to 0 to disable. |
decom.autoDecompile.showStatusBar |
true |
Shows a status bar spinner while decompiling. |
Example disabling prompt & spinner with faster repeat:
{
"decom.autoDecompile.promptJarLargerThanMB": 0,
"decom.autoDecompile.showStatusBar": false,
"decom.autoDecompile.debounceMs": 250
}
Troubleshooting
Common issues:
Symptom |
Likely Cause |
Fix |
"Decompilation failed" with Invalid or corrupt jarfile |
Damaged or zero‑byte cfr-0.152.jar |
Replace with a fresh download |
Nothing happens after selecting file |
decom.output.path not set |
Set a writable folder in settings |
Java not found |
PATH lacks java and no JDK path set |
Configure decom.java.jdk.home |
Empty output folder |
Unsupported / obfuscated class or failure mid-run |
Check VS Code output / retry with different class |
View the developer tools console (Help → Toggle Developer Tools) for deeper diagnostics if needed.
Known Issues
- Only the first single-class decompiled file is auto-opened.
- Cancellation is only available for auto-decompile (notification Cancel action); manual commands still run to completion.
Release Notes
1.0.0
- Project cleanup for stable release: removed legacy Hello World command, private repository links, and "Trial" branding.
- Simplified activation (lazy load on command usage).
- Documentation streamlined.
0.0.5
- Added right-click Explorer & editor title context menu actions to decompile selected
.jar
or .class
directly (skips file picker).
0.0.4
- Changed JAR output directory layout to put timestamp first for easier chronological grouping: now
OUTPUT_PATH/<timestamp>/<jarName>/
(was OUTPUT_PATH/<jarName>/<timestamp>/
). Applies to manual and auto decompile.
0.0.3
- Fixed opening of decompiled single CLASS files when CFR outputs nested package folder structure (now searches recursively and opens the correct
<package>/ClassName.java
).
- Applies to both manual and auto-decompile paths.
- Internal: added recursive file locator helper.
0.0.2
- Switched implementation to use the bundled CFR decompiler JAR (
cfr-0.152.jar
).
- Added timestamped output subdirectories.
- Added proprietary licensing + third‑party notices.
- Added keywords and privacy statement; no telemetry.
- Renamed command titles to reference CFR instead of Fernflower.
- Added new setting
decom.jar.openFolder
(default true) to optionally suppress automatic folder opening after JAR decompile.
- Added automatic decompile-on-open feature with
decom.autoDecompile.mode
(default both
).
- Added cancellation (auto-decompile only) via notification action.
- Added large JAR size prompt (
decom.autoDecompile.promptJarLargerThanMB
).
- Added debounce control (
decom.autoDecompile.debounceMs
).
- Added status bar spinner toggle (
decom.autoDecompile.showStatusBar
).
- Added option to close original binary editors (
decom.autoDecompile.closeOriginal
).
0.0.1
- Initial release using a Fernflower-based approach (legacy docs).
Privacy / Telemetry
This extension does not collect, transmit, or store telemetry or usage data. All processing happens locally. If optional telemetry is ever added, it will be opt‑in and documented here.
Licensing
Copyright © 2025 DZH International Pte. Ltd. – All rights reserved.
This extension is proprietary. See LICENSE.txt
for full terms. Third‑party components and their licenses are listed in THIRD_PARTY_NOTICES.txt
.
Bundled third‑party:
- CFR Java Decompiler (MIT License)
Third-Party & Attribution
The CFR license text is included verbatim in THIRD_PARTY_NOTICES.txt
.
Future Improvements (Planned)
- Add option to open all decompiled files in an explorer tree view.
- Refactor manual & auto paths to share a single decompile runner.
- Support cancellation for manual (command-initiated) decompile runs.
- Provide a custom editor for JARs with integrated progress UI.
Contributing
Currently internal / closed-source. Please contact the publisher for inquiries.
Support
Issues: (internal Bitbucket repository) or your internal support channel.