Eclipse Jee + maven + m2eclipse compilation error

Source: Internet
Author: User
This problem is characterized by the use of Eclipse integration Maven development project, after executing the clean command, the original compiled results are cleared, and then in the edit, compile source code or run Times "XXX (Class) cannot be resolved to a type" error, Eclipse's Package Explorer window appears with a large number of red forks. This behavior is cleared by commands outside the IDE, and the IDE cannot find the compiled file.

The solution is to find the project-> build automatically in the Eclipse menu and make sure it's checked, and then click Project-> Clean ... menu command items, in the pop-up dialog to find the project, if it is a number of engineering dependent development, you can choose "Clean all projects", and then click the "OK" button. This process eclipse clears the. class file compiled in the project while recompiling the project (similar to the Rebuild feature in Jbuild).

We know that Maven can host the entire lifecycle of a project, and it participates in the entire series of validation, source control, compilation, testing, packaging, distribution, deployment (installation). The IDE can also do these things, so there will be repetitive but not intelligently collaborative actions, MAVEN clears the Eclipse compilation results, and Eclipse is clamoring for the Red Cross.
compilation on Eclipse always does not find the path to the class
Solution:
Windows->preferences->java->installed JREs->, add Tools.jar
or windows->preferences->java->installed JREs-> to use the JRE instead of using the JDK.

Or


<dependency>

<groupId>com.sun</groupId>

<artifactId>tools</artifactId>

<version>1.6.0</version>

<scope>system</scope>

<systempath>c:/program files/java/jdk1.6.0_23/lib/tools.jar</systempath>

</dependency>

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.