How to use dependent projects in Eclipse (Required projects) instead of Jars

Source: Internet
Author: User

Recently want to see the source of spring, under the source, build a simple example of hellospring Web project, using the project relies on the use of the source of the class. Set up and start the Tomcat report java.lang.ClassNotFoundException:org.springframework.web.servlet.DispatcherServlet error. Refer to the following article.

The benefit of replacing a jar with a dependent project (Required projects) in eclipse is that you can change the code in the dependent project at any time and refer to the latest compilation class in the main project. This approach is very useful when debugging, avoiding the hassle of packaging a jar after each modification of the dependent package source code, and constantly updating the main project jar package. Such project references are very common in open-source projects.

1. Delete the corresponding jar file in the main project, such as: Framework.jar.

2. Right-click the project->properties->java Build path->projects->add and select the dependent project, such as: Framework->ok (Save Settings) to this step, Your master project will compile without errors, and the class that has the error to delete the jar file will compile correctly.

3. If your project is a Web project and you need to deploy debugging, you must also make the following settings: Right-click Project->properties->deployment assmebly->add, select Projects, select the Target project framework Save.

This will also be dependent on the project release at the time of the main project release. Otherwise, although it compiles successfully, it will error when publishing to the server: ClassNotFound.


How to use dependent projects in Eclipse (Required projects) instead of Jars

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.