How to decompile. class files as. java files

Source: Internet
Author: User

It is wrong to decompile others' programs, but sometimes, for some reason, you have to decompile others' code, you need a tool. Xiaoying Java source code decompilation expert v1.4 development version is a good tool, but it can only decompile the programs compiled by JDK 1.4.2 and earlier versions, and JDK and later cannot be used, but you can download Jad. EXE to decompile class files one by one, but if there are dozens or hundreds of folders, And the directory is very deep, it will be troublesome, this provides a method to decompile the entire directory directly using the command line: Batch decompilation using Jad
Jad-o-r-sjava-d src bin/**/*. Class
SRC: indicates the reverse structure of the object.
Bin: indicates the start of a package.
Decompile all. Classes in BIN to SRC

 

 

How to decompile A. Class file into a. Java File

The simple usage of The Decompilation tool Jad is to put jad.exe in the C:/Java directory.

I. Basic usage: Jad [option (s)] directly enters the class file name and supports wildcards, as shown below.

C:/Java/> Jad example1.class C:/Java/> Jad *. Class: decompile example1.class to example1.jad.

Change example1.jad to example1.java to get the source file.

2. If option-O is not displayed, overwrite the source file

Iii. Option-s c:/Java/> Jad-sjava example1.class decompilation result with. Java as the extension.

4. Option-P outputs The Decompilation result to the screen C:/Java/> Jad-P example1.class redirects the decompilation result to the file

C:/Java/> Jad-P example1.class> example1.java

5. Option-D specifies the decompiled output file directory c:/Java/> Jad-o-Dtest-sjava *. Class

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.