How to convert a. Class file to a. Java file -- Java decompilation tool Summary

Source: Internet
Author: User
Tags java decompiler

Q: The project war file does not contain Java source files, but only the. Class file. How can I import the War Project to myeclipse ??

My practice: Convert. decompile the class file. java file, decompilation software I use Java decompiler ", developed by Pavel Kouznetsov. The latest version is 0.2.5. it is developed by C ++ andOfficial downloadExecutable programs on Windows, Linux, and Apple Mac OS.

How to import existing web programs to the myeclipse Environment

If you want to import a war Package published by someone else to your eclipse environment for further development, the fastest way is as follows:

1. Create a New myeclipse web project.

2. Right-click the project, set myeclipse/Add struts capability to the struts development environment.

3. decompress the war package and overwrite the webroot (including the web-INF/meta-INF directory) of the new project ), the corresponding SCR directory (or corresponding directory containing java files) overwrites the src directory of Eclipse. Myeclipse will automatically put the jar package under the WEB-INF/lib as in classpath.

4. Refresh the project, over.

The Java language was released by sun in May 1995. Due to its high security, code optimization, and cross-platform features, it quickly replaced many traditional advanced languages, it is dominant in enterprise network application development and many other fields. However, Java's most prominent cross-platform advantages prevent compilation costs. The Java language was released by sun in May 1995. Due to its high security, code optimization, and cross-platform features, it quickly replaced many traditional advanced languages, it is dominant in enterprise network application development and many other fields. China Network Management Alliance WWW, bitscn, com

However, Java's most prominent cross-platform advantage makes it impossible to compile the code at the cost, but it must run in the form of intermediate code in the virtual machine environment, this makes Java decompilation easier to implement than other advanced languages, and the decompilation code is almost comparable to the source code after optimization.
In order to better protect intellectual property rights and prevent the company's intellectual achievements from being easily stolen, developers need to have a deep understanding of the decompilation tool to take targeted protection measures.
Currently, there are nearly 30 popular Java decompilation tools, of which three are excellent:
I. Widely used Jad
Among the many Java decompilation tools, several well-known tools use the same core engine, Jad, which mainly includes: front end plus, mdejava, decafe pro, cavaj Java decompiler, DJ Java decompiler, NMI's Java class viewer and domestic Java source code decompilation experts.
Jad itself is a command line tool without a graphical interface. Most of the above tools Add a graphical interface based on the Jad kernel. The joint selection of these products proves the distinguished position of Jad in the field of Java decompilation.
The Jad version I used to test is 1.5.8f.
Jad is developed using Microsoft Visual C ++ and runs very fast. It can process complex Java compilation files. Many parameters enable Jad to cope with multiple encryption methods flexibly, making the decompiled code more optimized and easier to read. Because there are too many Jad parameters, there is no need to explain them one by one. Several of the most common ones are as follows:

54com.cn

-D
-Used to specify the directory of the output file
-S-output file extension (default:. JAD). Generally, the output file extension is directly specified as. Java to facilitate modification and re-compilation.
-8-convert Unicode characters to ANSI strings. If the output string is Chinese, you must add this parameter to display it correctly.
The most common decompilation commands are as follows:
Jad-d c: // javasource-S. Java-8 javatest. Class
This command decompile javatest. Class in the current directory into javatest. Java and save it in the C: // javasource directory. The prompt output is Chinese, not Unicode code.
Ii. Open source code jode
Jode is a member of sourceforge.net, the world's largest open-source project website. Don't underestimate it if the source code is open. Among all Java anti-compilers, Jode has the best decompilation effect, this is especially true for some common encryption methods, such as obfuscation technologies.
Jode is also developed in pure Java. Recently, more and more java decompilation software also chooses jode as their core engine, such as jcavaj Java decompiler and btj (back to Java) and jedit's javainsight plugin.
Jode is a runable JAR file, which can be run by double-clicking in windows.

Www.bitscn.com

Note that jode does not load the class file compiled by Java in the conventional open-> file mode (*. class) or class package (*. jar), but through the set classpath In the Options menu. A separate class file can use its upper-level directory as the classpath input, and then select reload classpath.

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.