Import the MyEclipse web project into Eclipse

1. Enter the project directory, find the .project file, and open it.
Add a <buildCommand> (if there is one, don't add it)

[java]  view plain copy  
  1. <buildCommand>  
  2. <span style="white-space:pre">    </span><name>org.eclipse.wst.validation.validationbuilder</name>  
  3.     <arguments>  
  4.     </arguments>  
  5. </buildCommand>  
2. Find the <natures>…</natures> code segment. Add the following label content and save:

[java]  view plain copy  
  1. <natures>  
  2.     <nature>org.eclipse.wst.common.project.facet.core.nature</nature>    
  3.         <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>    
  4.     <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>     
  5. </natures>  

4. In the .classpath file in the project directory, change all WebRoot strings to WebContent and save.

5. Under the .setting folder in the project directory: org.eclipse.wst.common.component file, change all WebRoot strings to WebContent, save

6. Rename the WebRoot folder in the directory to WebContent.

7. Add the packages required by the web server in the Libraries of the Java Resources: src directory in eclipse, select BuildPath-->configure Build Path-->Select Add Library-->server Runtime->select the required ones under the current window web server

8. Right-click on the eclipse project and refresh the project.

9. Right-click on the project, enter properties, click and select "Project Facets" in the list item on the left, select "Dynamic Web Module" and "Java" on the right, and click Save.


If the project compiles normally without error, you don't need to read it next time.

I encountered such a problem. I searched the Internet for a long time and couldn't find any solution. Finally, I thought about it myself.


Since jstl is used in MyEclipse, it is also imported into Eclipse. How to remove jst.web.jstl and me.spring?

1. Modify the org.eclipse.wst.common.project.facet.core.xml file in the project .setting folder and put

[java]  view plain copy  
  1. <installed facet="jst.web.jstl" version="1.2.1"/>  
  2. <installed facet="me.spring" version="4.1"/>  
Delete these two lines.

2. Modify the .classpath file and remove it

[java]  view plain copy  
  1. <attribute name="owner.project.facets" value="jst.web.jstl"/>  


PS:

a> If you do not modify the second step, then you may report the following error when modifying Project facts:

Failed while changing version of Java to 1.8. Project facet jst.web.jstl has not been defined.

b> If you do not modify the above fifth "5. The .setting folder in the project directory: org.eclipse.wst.common.component file, change all WebRoot strings to WebContent, save", may report The following error:

The Web App Libraries in the Eclipse java build path cannot automatically find the lib directory of WEB-INF

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325477047&siteId=291194637