Let eclipse identify the MyEclipse Web project

Source: Internet
Author: User

method One: change Webroot to WebContent (try it not very good to use the recommended Method II)

 method Two:1. go to the project directory, locate the. project file, open. 2.Find <natures>...</natures> Code Snippets3.in the 2nd step of the code snippet, add the following label content and save: <nature>org.eclipse.wst.common.project.facet.core.nature</nature><nature >org.eclipse.wst.common.modulecore.ModuleCoreNature</nature><nature> Org.eclipse.jem.workbench.javaemfnature</nature> 4.Right-click on the Eclipse project to refresh the project. 5. Right-click on the project to enter properties6. Click on "Project Facets" in the list item on the left, select "Dynamic Web Module" and "Java" on the right, click Save7. Enter the project directory to find the source-path=web of the Org.eclipse.wst.common.component file modified under. setting, (MyEclipse defaults to Webroot according to the web directory name change) Other options can be changed as well. 8. This is what eclipse has identified, but when using the Export War package feature of Eclipse, you will find that there is a problem with exporting only class and change the path of the project in the Org.eclipse.wst.common.component file.  The original file contents are as follows:

<?xml version= "1.0″encoding=" utf-8″?>
<project-modules id= "Modulecoreid" project-version= "1.5.0″>
<wb-module deploy-name= "PIS" >
<wb-resource deploy-path= "/" source-path= "/web"/>
<wb-resource deploy-path= "/web-inf/classes" source-path= "/src"/>
<property name= "Context-root" value= "PIS"/>
<property name= "Java-output-path" value= "/pis/webroot/web-inf/classes"/>
</wb-module>
</project-modules>

Change to:

<?xml version= "1.0″encoding=" utf-8″?>
<project-modules id= "Modulecoreid" project-version= "1.5.0″>
<wb-module deploy-name= "PIS" >
<property name= "Context-root" value= "PIS"/>
<property name= "Java-output-path" value= "/pis/web/web-inf/classes"/>
<wb-resource deploy-path= "/" source-path= "/web"/>
<wb-resource deploy-path= "/web-inf/classes" source-path= "/src"/>
</wb-module>
</project-modules>

Problem

I. The server does not support version 3.0 of the Java EE WEB Module specification

1. Error:

When using Run->run on server in Eclipse, select Tomcat6 to report an error: The server does not support version 3.0 of the Java EE Web module Specifica tion

2. Reason:

Tomcat 6.0 supports up to Servlet 2.5, and now the item to import is version 3.0.

3. Workaround:

There is a. Settings folder under the project root directory, which has a org.eclipse.wst.common.project.facet.core.xml file with the following contents:

<?xml version= "1.0" encoding= "UTF-8"?>
<faceted-project>
<fixed facet= "Java"/>
<fixed facet= "Jst.web"/>
<fixed facet= "Wst.jsdt.web"/>
<installed facet= "java" version= "1.6"/>
<installed facet= "Jst.web" version= "3.0"/>
<installed facet= "Wst.jsdt.web" version= "1.0"/>
</faceted-project>

Put

<installed facet= "Jst.web" version= "3.0"/>

Switch

<installed facet= "Jst.web" version= "2.5"/>

Can

Two

Project Facet Java version 1.7 is not supported.

When you migrate an Eclipse project, you encounter

"Project facet Java version 1.7 is not supported."

The jdk1.7 in the project is not supported. Note that the project was compiled by other versions of the JDK and is not supported when running in Eclipse.

Workaround :

Method 1, select the project Properties, choose Project Facets, right-click Select Java, change Version ... Can.

Law 2, in the project directory there is a . Settings folder, under which there is a org.eclipse.wst.common.project.facet.core.xml file with the following contents ;

<?xml version= "1.0" encoding= "UTF-8"?>
<faceted-project>
<fixed facet= "Jst.java"/>
<fixed facet= "Jst.web"/>
<installed facet= "Jst.web" version= "2.4"/>
<installed facet= "Jst.java" version= "6.0"/>
</faceted-project>

Modify <installed facet= "Jst.java" version= "6.0"/> to <installed facet= "Jst.java" version= "5.0"/> .

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.