Bytecode to java decompiler

JD Project

The “Java Decompiler project” aims to develop tools in order to decompile and analyze Java 5 “byte code” and the later versions.

JD-GUI is a standalone graphical utility that displays Java source codes of “.class” files. You can browse the reconstructed source code with the JD-GUI for instant access to methods and fields.

JD-Eclipse is a plug-in for the Eclipse platform. It allows you to display all the Java sources during your debugging process, even if you do not have them all.

JD-Core is a library that reconstructs Java source code from one or more “.class” files. JD-Core may be used to recover lost source code and explore the source of Java runtime libraries. New features of Java 5, such as annotations, generics or type “enum”, are supported. JD-GUI and JD-Eclipse include JD-Core library.

JD-Core, JD-GUI & JD-Eclipse are open source projects released under the GPLv3 License.

  • JD-Core and JD-GUI are written in Java.
  • JD-Core works with most current compilers including the following:
    • JDK 1.1.8, JDK 1.3.1, JDK 1.4.2, JDK 1.5.0, JDK 1.6.0, JDK 1.7.0, JDK 1.8.0, JDK 9.0.1, JDK 10.0.2
    • jrockit90_150_06
    • jikes-1.22
    • harmony-jdk-r533500
    • Eclipse Java Compiler v_677_R32x, 3.2.1 release

    JD-GUI

    JD-GUI is a standalone graphical utility that displays Java source codes of “.class” files. You can browse the reconstructed source code with the JD-GUI for instant access to methods and fields.

    Источник

    .JAR and .Class to Java decompiler

    Until recently, you needed to use a Java decompiler and all of them were either unstable, obsolete, unfinished, or in the best case all of the above. And, if not, then they were commercial. The obsoleteness was typically proved by the fact that they can only decompile JDK 1.3 bytecode.
    The only so-so working solution was to take the .class file and pre-process it, so it becomes JDK 1.3 compatible, and then run Jad over it (one of those older, but better decompilers).

    But recently, a new wave of decompilers has forayed onto the market: Procyon, CFR, JD, Fernflower, Krakatau, Candle.
    Here’s a list of decompilers presented on this site:

    CFR

    This free and open-source decompiler is available here: http://www.benf.org/other/cfr/
    Author: Lee Benfield

    • Java 7: String switches
    • Java 8: lambdas
    • Java 9: modules
    • Java 11: dynamic constants
    • Java 12: Kotlin style «switch expressions»
    • Java 14: ‘instance of’ pattern match and ‘Record types’
    JD

    free for non-commercial use only, http://jd.benow.ca/
    Author: Emmanuel Dupuy

    Updated in 2015. Has its own visual interface and plugins to Eclipse and IntelliJ . Written in C++, so very fast. Supports Java 5.

    Procyon
    • Enum declarations
    • Enum and String switch statements
    • Local classes (both anonymous and named)
    • Annotations
    • Java 8 Lambdas and method references (i.e., the :: operator).
    Fernflower

    Updated in 2015. Very promising analytical Java decompiler, now becomes an integral part of IntelliJ 14. (https://github.com/JetBrains/intellij-community/tree/master/plugins/java-decompiler)
    Supports Java up to version 6 (Annotations, generics, enums)

    JAD

    given here only for historical reason. Free, no source-code available, jad download mirror
    Author: Pavel Kouznetsov

    Probably, this is the most popular Java decompiler, but primarily of this age only. Written in C++, so very fast.
    Outdated, unsupported and does not decompile correctly Java 5 and later.

    Источник

    Java bytecode decompiler

    Make sure that the Java Bytecode Decompiler and Bytecode Viewer bundled plugins are enabled. For more information, refer to Install plugins.

    IntelliJ IDEA features the Java bytecode decompiler that shows you compiled bytecode as if it were human-readable Java code. The decompiler is enabled by default.

    Open a compiled .class file in the editor.

    If it’s the first time that you’re opening a compiled file, the IDE prompts you to agree to the specified terms and conditions in the JetBrains Decompiler dialog. If you click Accept , the dialog will not be displayed in the future and the appropriate code will be automatically decompiled.

    JetBrains Decompiler dialog

    If you change your mind and want the JetBrains Decompiler dialog to appear again, disable the Java Bytecode Decompiler plugin in settings and open any compiled file in the editor.

    After that the IDE will show you the human-readable Java code without actually converting .class files into .java files.

    The yellow notification panel above the editor informs you that you’re reading a decompiled file.

    A compiled file in the editor that has been automatically decompiled by IDE

    Show bytecode for compiled files

    By default, the IDE shows you decompiled code in compiled files. If necessary, you can open the bytecode viewer for any compiled class.

    Open a compiled file in the editor and select View | Show Bytecode from the main menu.

    The bytecode viewer provides basic syntax highlighting, and it shows the information in a way that is comfortable for reading.

    Compiled file opened in the bytecode viewer

    The decompiler can also debug your code, so you can use breakpoints anywhere in the decompiled code.

    Источник

    Look Inside Compiled Code with Java Bytecode Decompiler

    JetBrains

    When something is there for us day after day, we tend to take it for granted. In IntelliJ IDEA, there are several features that many people don’t even notice, even as they use them all the time. One of these features is the Java bytecode decompiler.

    IntelliJ IDEA: how2pro banner

    The Java bytecode decompiler in IntelliJ IDEA is a built-in tool that allows you to read compiled bytecode as if it were human-readable Java code.

    Let’s say you have a library packed in a .jar file. You just downloaded it from the Internet and don’t have the source code for it. How do you look inside and make sure it actually has what you need?

    If you open a .class file in a text editor, you’ll only see the bytecode that sometimes makes little sense. However, if you open the same file in IntelliJ IDEA, the IDE shows you the human-readable Java code from your .jar, without actually converting .class files into .java files. The yellow notification panel above the editor informs you that you’re reading a decompiled file.

    decomplier2

    The decompiler can not only convert bytecode to Java code, but it can also debug it. This means you can use breakpoints anywhere in the decompiled code with almost the same experience that you’d normally have when you debug your source code.

    decompiler-debugger2

    Of course, you can always open the bytecode viewer for any compiled class. Open the necessary .class file in the editor in IntelliJ IDEA and then select View | Show Bytecode from the main menu. If you’re not seeing this option, make sure that the bundled Bytecode Viewer plugin is enabled.

    The bytecode viewer provides basic syntax highlighting, and it shows the information in a way that is comfortable for reading.

    decompiler-bytecode

    The decompiler works in both IntelliJ IDEA Ultimate and IntelliJ IDEA Community Edition. It is powered by the Java Bytecode Decompiler plugin, which is bundled and enabled by default.

    This tool has been a part of IntelliJ IDEA for ages. So if you already have the IDE, give it a try and let us know what you think in the comment section. If you don’t have IntelliJ IDEA yet, grab a build or stay tuned for more news, because very soon we’re releasing IntelliJ IDEA 2020.1, which features our Java bytecode decompiler together with a range of exciting features and updates.

    Источник

    Читайте также:  Html перевод строки div
Оцените статью