Java compiler level does not match solution

Source: Internet
Author: User

When importing a project from another place, you will often encounter Eclipse/myeclipse description Resource Path location Type Java compiler levels does not match the Vers Ion of the installed Java project facet. This problem occurs because the Eclipse/myeclipse JDK build version is inconsistent with the problematic JDK compilation version of the project!

1, first set up the JDK, need to determine the project, Eclipse/myeclipse, the system is using the same version of the JDK, such as the system installed JDK is 1.7, so the eclipse JDK into 1.7

2, enter the windows---proferences---java--compiler settings compiled files using the format is 1.7 version (set to how many lines, as long as compatible, and with your project compiled version always can, I here unified set to 1.7)

3, into the project--properties---Java Compiler the project compiled version also set to 1.7

4, enter the project--properties---myeclipse---project facets set the Java file version to 1.7, and tick.

5, finally re-import the project documents.

Additional notes:

If you cannot publish deployed after re-importing the project, check the Org.eclipse.wst.common.project.facet.core.xml profile in the. Setting folder in the project directory.

<?xml version= "1.0" encoding= "UTF-8"?>
<faceted-project>
<runtime name= "Com.genuitec.runtime.generic.jee60"/>
<fixed facet= "Wst.jsdt.web"/>
<fixed facet= "Java"/>
<fixed facet= "Jst.web"/>
<installed facet= "java" version= "1.7"/>
<installed facet= "Jst.web" version= "3.0"/>
<installed facet= "Jst.web.jstl" version= "1.2.1"/>
<installed facet= "Wst.jsdt.web" version= "1.0"/>
</faceted-project>

After modifying the configuration file, re-import and republish.

Related error Handling:

Unsupported Major.minor version 51.0 workaround

Reason for error: The class file compiled with JDK7 is placed in Tomcat based on JDK6 and will be reported.

Workaround:

Open the properties on the project in Exclipse-java compiler– Select an appropriate version and recompile.

Specific steps

FIX: Project------> Right------> Properties------>java Compiler------>compiler Compliance level------> Select the JDK version you are using------> Apps.

Summary: Different JDK versions use different major.minor, which can cause this error. In the project to use the current computer configuration of the JDK version, avoid pigtailed.

Knowledge Expansion: Major.minor version, which is equivalent to the primary and secondary versions of a software, just here is the main and minor version number of a Java class that is identified.

Java compiler level does not match solution

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.