Talking about the decompile of Java program

Source: Internet
Author: User
Tags bit set

Now that the Java language is wildly popular around the world, it is widely used in the production of Internet databases, multimedia, CGI, and Dynamic Web pages. Demand for Java programmers in the United States exceeded c++! for the first time in 1999

Because of the recent analysis of some Java programs, the compiler of the Java has a bit of understanding, the following I understand the situation described below, I hope to help Java enthusiasts.

Java is a program structure called "Byte Encoding", which is divided into small programs (embedded in HTML files) and applications (executed directly in the command state) of two types. Regardless of the structure, once compiled with the Javac command, it becomes an executable with the same name as the suffix class. This file is not readable code.

After reviewing the Sun's JDK (JDK1.1.3) documentation, I found a javap file (EXE) that was supposedly decompile Java, located under \jdk\bin\, and was disappointed after being used by the instructions, which turned out to be a "decompile" You can only decompile the data area (definition) of a Java program, references to several methods, and classes, and so on.

Here I use a simple example to illustrate the problem.

Java source program Hello_java.java is as follows:

Import java.applet.*;

Import java.awt.*;

public class Hello_java extends Applet

{

public void Paint (Graphics g)

{

g.DrawString ("Hello java!\n", 20,20);

}

}

Anti-compile command: javap-c-package-public-private Hello_java Hello.java

The resulting decompile results (Hello.java) are as follows: (see the instructions for selecting the JAVAP command, here-C indicates that the decompile was selected)

Compiled from Hello_java.java

Public synchronized class Hello_java extends Java.applet.Applet

/* Acc_super bit set */

{

public void paint (java.awt.Graphics);

public Hello_java ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.