Java Decompiler

Java Decompiler

Decompiler for Java Class files.

Once you have installed the package, you can access the decompiler from the bytecode view. The bytecode view and the decompiler are accessible not only within Java Class files but also within JAR files.

The interface provides a quick filter to show only matching namespaces, classes, and methods.

To switch between the bytecode and the decompiler, you can use the combo box at the top.

Alternatively, and even more conveniently, you can use the ‘Tab’ key to toggle between the bytecode and the decompiler, which will bring you directly from the Java code to the corresponding bytecode and vice versa.

You can navigate the code both when viewing the bytecode and the decompiled output. The ‘Esc’ key will bring you back to the previous position, just like in the Carbon disassembly view.

The ‘Strings’ button displays all referenced strings in the code, showing which class and method reference them. It also allows you to jump to the location where they are referenced, both in the bytecode and in the decompiled output.

Additionally, the strings view features a filter to quickly find strings of interest.

The package is exposed to the SDK. The following code snippet demonstrates how to decompile a Java class file:

from Pkg.JavaDecompiler import *

def main():
    dec = JavaDecompiler()
    dec.init(r"file.class")
    text, _ = dec.decompile()
    if text != None:
        print(text)