Workaround for Eclipse Import Web project error due to JDK version issue

Source: Internet
Author: User

Before several times encountered such a situation: in the school to write a good project, back to the bedroom with their own computer import project results appear a big exclamation. I have packaged the original project directly, and then, after extracting it, import the existing project into the working range with eclipse.

Where the red forks appear in the project are mainly data types that are not recognized:

The most typical error is "String cannot is resolved to a type"

After the problem went to Baidu a bit, and then the great God said that this is because the JDK version is not set up or set inconsistencies, that is, the version of Window->preferences->java->compiler and installed JRE inconsistent, I have jdk1.7 installed on my computer, and the most suitable compiler I have installed is 1.6, and it's a hassle to reinstall a jdk1.6.

Then found a better solution: Right-click on the project->properties->build path-> Select Libraries column, you can see the Red fork, This shows that the original project with the jdk1.6 version, and now the computer is installed on the jdk1.7, so the error will be displayed. Remove this error item, add LIBRARY->JRE System library->installed jres-> Select the installed jdk->finish that you want to add. The quicker way to do this is to select the error item directly->edit-> Select the installed jdk->finish that you want to add. It is found here that even if the compiler and installed JRE are inconsistent, there is a problem with the Eclipse project import error caused by the JDK version issue.


→ Portal: Importing Web projects into Eclipse common errors

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.