Debug jar package source code in Eclipse (debug Struts2 source)

Source: Internet
Author: User

First create a new project in Eclipse, add the jar files needed to run Struts2, and add them to the project's Classpath (in Lisbs, right-click the build path such as:

), after the successful interface 1-17 is shown. ( Remember to right-click the jar package in referenced libraries )

Figure 1-17 New project in Eclipse

Next, let's attach the corresponding source code for these jar files added to the classpath. Take "Struts2-core-2.2.1.jar" as an example, right-click on "Struts2-core-2.2.1.jar", select the properties (Alt + Enter) tab, pop up the jar file's property options box, shown in 1-18.

(Click to view larger image) Figure 1-18 Attach the source bundle for the jar file

Select the "Java Source Attachment" option on the left side of the tab, click the button on the right side of the input box, specify the directory where the source code is located or the jar file (zip file) where it is located, click the OK button and the library file is appended with the corresponding source code (at this point, We will find the form of the jar file forms of source code in the management of the convenience, we can even put the source file into a workspace repository directory is referenced by all library files.

After the library file is attached to the source code, expand the library file, and double-click on the class file, you can see the class file corresponding to the source, 1-19 is shown.

(Click to view larger image) Figure 1-19 Viewing the source code in eclipse

After the library file is appended with its corresponding source code, we can use the Eclipse IDE features and shortcut keys to view and analyze the source code.

Debug jar package source code in Eclipse (debug Struts2 source)

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.