zoukankan      html  css  js  c++  java
  • How to Convert a Class File to a Java File?

    What is a programming language?

    Before introducing compilation and decompilation, let's briefly introduce the Programming Language. Programming languages ​​are divided into low-level languages ​​and high-level languages.

    Machine language and assembly language are low-level languages, and programs are written directly with computer instructions.
    C, C ++, Java, and Python are high-level languages. Programs are written in statements, which are abstract representations of computer instructions.

    What is compilation?

    There are two languages ​​mentioned above, a low-level language and a high-level language. Simple understanding: low-level languages ​​are languages ​​recognized by computers, and high-level languages ​​are languages ​​recognized by programmers.
    So how do you switch from a high-level language to a low-level language? This process is actually compiling.

    The process of translating source code programs written in high-level computer languages ​​that are easy to write, read, and maintain into low-level machine language programs that can be interpreted and run by computers is compilation. The tool responsible for this process is called a compiler

    Now we know what a compiler is and what a compiler is. Different languages ​​have their own compilers. The compiler responsible for compiling in Java is a command: javac

    After we write a HelloWorld.java file, we can use the javac HelloWorld.java command to generate a HelloWorld.class file. This class file is a file recognized by the JVM. Usually we think of this process as the compilation of the Java language. In fact, the class file is still not a language that the machine can recognize, because the machine can only recognize the machine language, and the JVM needs to convert this class file type bytecode into a machine language that the machine can recognize.

    javac is a Java language compiler included in the JDK. The tool can compile source files with the extension .java into bytecodes with the extension .class that can run in the Java virtual machine.

    What is decompilation?

    The process of decompiling is just the opposite of compiling, that is, restoring the compiled programming language to an uncompiled state, that is, finding the source code of the programming language. Is to translate the language that the machine understands into a language that the programmer can understand. Decompilation in the Java language generally refers to converting a class file into a java file.

    With decompilation tools, we can do many things. The main function is that with decompilation tools, we can understand the bytecode generated by the Java compiler. For example, we can gain insight into the principles behind Java's syntactic sugar.

    Java commonly used decompilation tools

    This article mainly introduces 4 Java decompilation tools: javap, jad and cfr, and visual decompilation tool JD-GUI.Or you can use online tool wesite - Java Decompiler Online.

    What is Java Decompiler Online?

    Java Decompiler Online is an online tool for decompiling class files to java source files which supports .class, .jar, .zip and other file formats. It's the best online tool to decompile java code quickly and intelligently.

    3 Steps to Decompiler Java Class File

    Step 1: Choose Java Class File

    Drag the specified java class file to the upper area or click the above button to select the file, enter the verification code and confirm to upload the file.

    Step 2: Waiting for Decompilation

    Java class file will be decompiled after the file is uploaded. Please wait patiently if the file is too large.

    Step 3: Download The Decompiled Java Source Code File

    Open the file in the corresponding folder, and click the download button in the upper right corner to download.

    By the way, please contact us if you have any question. Don't miss to share on facebook etc.

    转载,请保留原文地址,谢谢 ~

  • 相关阅读:
    Mac nginx 简单文件服务器
    cocos-lua
    Sublime Text 3 快捷键精华版
    VS中dumpbin工具的使用
    【2022新教程】Ubuntu server 20.04如何安装nvidia驱动和cuda-解决服务器ssh一段时间后连不上的问题
    linux如何将一个正在运行的进程转入到后台执行且中断shh连接不被kill掉
    Ubuntu如何修改默认python版本-sudo和不用sudopython不一致怎么办
    Ubuntu中virtual enviroment在sudo下无效怎么办?
    时间复杂度为O(1)的抽样算法——别名采样(alias sample method)
    Luke技术小站公告板
  • 原文地址:https://www.cnblogs.com/Alandre/p/12348862.html
Copyright © 2011-2022 走看看