View/debug the code in the jar package in eclipse

Source: Internet
Author: User
Tags zip tomcat

The source code situation, for example: SSH framework is generally available in the open source community can be downloaded to the source code

1. On the jar package referenced in the Web project, right click on the properties, pop up the dialog box. Select Java source Attachment and select the Jar package source code (possibly a zip or jar file) from the local directory. For example, I downloaded a springmvc frame with a spring-core-3.2.9.release-sources.jar, that's him.

2, after the success, the project JAR file icon will change, and double-click the jar in the class file can directly view the source program and can set breakpoints for debugging.

JDK Source path: java_home/src.zip

Tomcat Source: https://tomcat.apache.org/download-70.cgi, source Code distributions PS: When you manage a project with Maven, you enter window-from eclipse >preferences->maven, will download artifact sources hook, update Maven project will automatically download and associated jar corresponding source code.

If Maven cannot download automatically and cannot download the source and Javadoc from the Maven right-click menu, the following command is available: MVN eclipse:eclipse-ddownloadsources=true-ddownloadjavadocs= True

Use Eclipse:eclipse-ddownloadsources=true-ddownloadjavadocs=true directly when running commands in the Eclipse environment.

Non-source information

Breakpoints cannot be set in the following plug-in manner.

Eclipse3.7.2 or 4.3 Installing the anti-compile plugin

Myeclipse10 Installing the anti-compile plugin

plugin Download Address:

Jad Plugin:

download Jad.exe file: Http://www.varaneckas.com/jad

Download Jadeclipse plugin:http://sourceforge.net/projects/jadclipse/files/

Plugin: Jad.exe,jadclipse_3.3.0.jar,net.sf.jadclipse_3.3.0.jar

org.sf.feeling.decompiler_1.0.3 Plugin:

Download Address:http://download.csdn.net/detail/u014079773/9555252


jad Plugin Installation:
Eclipse install plug-in steps:
1: Copy the downloaded Jad.exe to the bin directory of the JRE where the jdk1.7 is installed

Example: D:\Program files\java\jdk1.7.0_67\jre\bin\ 2: Copy the downloaded Jadeclipse_3.3.0.jar to the plugins directory under the Eclipse installation directory

Example: D:\eclipse\plugins 3: Open Eclipse, then windows->preferences->java->jadclipse, then set path to Decompiler for Jad.exe in the local environment path

such as: D:\Program Files\java\jdk1.7.0_45\jre\bin\jad.exe

Use Eclipse code Formatter (Overrides Jad formatting instructions) option ticked, consistent with formatted code style.

Directory for Temporaryfiles is the storage path generated by the temporary file and can not be modified. After modifying, click Apply to submit Save settings.

4: Under Eclipse window, click Window > Preferences > Java > Jadclipse > Misc to tick the convert Unicode strings into ANSI strings option. Avoid garbled characters that may occur after the decompile.

5: In General-edtiors-file associations, click. class to set its editor default to Jadclipse


Myeclispe Installing the plug-in steps:

1. Extract the Jad.exe into the Java \jdk\bin directory such as: D:\Program files\java\jdk1.7.0_67\jre\bin\

2. Copy the Jadeclipse plugin Net.sf.jadclipse_3.3.0.jar to the MyEclipse installation \common\plugins\ directory

3. Create the Jadclipse folder in Dropins in the MyEclipse installation directory and create features and plugins folders in the Jadclipse folder respectively, Net.sf.jadclipse_3.3.0.jar Copy to the features and plugins folders, respectively.

4. After starting MyEclipse, configure the Jadeclipse plugin

1) Under Eclipse window, click Window > Preferences > Java > Jadclipse > Path to Decompiler set to Jad.exe on the local environment path

such as: D:\Program Files\java\jdk1.7.0_45\jre\bin\jad.exe

Use Eclipse code Formatter (Overrides Jad formatting instructions) option ticked, consistent with formatted code style.

Directory for Temporaryfiles is the storage path generated by the temporary file and can not be modified. After modifying, click Apply to submit Save settings.

2) Under the Eclipse window, click Window > Preferences > Java > Jadclipse > Misc to tick the convert Unicode strings into ANSI strings option. Avoid garbled characters that may occur after the decompile.

3) in General-edtiors-file associations, click. class to set its editor default to Jadclipse


Second,org.sf.feeling.decompiler_1.0.3 plug-in installation:

Eclispe Installation

1. Create the folder "Eclispeplugin" in the Eclipse installation directory and create the subfolder "Decompiler"

2. Place the features and plugins under the extracted files into the created subfolder

The directory structure is as follows:


3. In the Eclipse installation directory "Dropins", create "Decomliler.link" to introduce the plugin path as follows:

Path=d:\\eclipse-3.7\\eclipseplugin\\decompiler

The directory structure is as follows:



MyEclipse Installation:

1. Create a folder "Decompiler" under the MyEclipse installation directory "Dropins"

2. Put the features and plugins under the extracted file into the created folder

The directory structure is as follows:



Eclipse or MyEclipse reboot, the following screenshot indicates the installation was successful:

Description:
1. Reuse Cache Code: is only recompiled once, and each time you open the class file, the cached anti-compilation code is displayed.
2. Ignore the existing source code: If unchecked, see if the class file is bound to the Java source code, if it is bound, display the Java source code, if not bound, then decompile the class file. If checked, the bundled Java source code is ignored and the results of the decompile are displayed.
3. Display the Anti-compiler report: Displays the data report and exception information generated by the anti-compiler after the decompile.
4. Use the Eclipse Code formatting tool: Use the Eclipse formatting tool to reformat the anti-compilation results, which consumes some time when you decompile the entire jar package.
5. Sort using Eclipse members: Use the Eclipse member sort to reformat the anti-compilation results, which consumes a lot of time when you decompile the entire jar package.
6. Output the original line number information as a comment: if the class file contains the original line number information, the line number information is printed to the anti-compilation results in a commented manner.
7. The aligning code is based on the line number to facilitate debugging: If selected, the plugin uses the AST tool to parse the results of the disassembly and adjust the order of the code according to the line number information to facilitate single-step tracking debugging during the debug process.
8. Set the class anti-compilation viewer as the default class file editor: default is selected, ignoring the eclipse's own class Viewer, each time eclipse starts, The class file is opened by default using the classes Viewer provided with this plugin.

Related Article

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.