1. Go to the project directory and locate the. project file, open.
2. Find the <natures>...</natures> code snippet.
3, in the 2nd step of the code snippet, add the following label content and save:
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
4. Delete the. setting files from other Eclipsejee Web projects [remember to use Eclipse to create a new] file under the. setting file to copy the following files [in fact, the entire folder is copied over]
. jsdtscope
Org.eclipse.jst.common.project.facet.core.prefs
Org.eclipse.wst.common.component
Org.eclipse.wst.common.project.facet.core.xml
Org.eclipse.wst.jsdt.ui.superType.Container
Org.eclipse.wst.jsdt.ui.superType.name
Modify the project name related content in Org.eclipse.wst.common.component
For example, the following jngl_mysql replace your project name.
Then Wb-resource is your resource file, the default is src one. If you're using maven maybe it's src/java/main,src/java/resource these things. Remember to add.
[HTML]View PlainCopyprint?
- <? XML version= "1.0" encoding="UTF-8"?>
- <project-modules id="Modulecoreid" project-version="1.5.0">
- <wb-module deploy-name="Jngl_mysql">
- <wb-resource deploy-path="/" source-path="/webroot" tag= "defaultrootsource" />
- <wb-resource deploy-path="/web-inf/classes" source-path="/src"/>
- <property name= "context-root" value="Jngl_mysql"/>
- <property name= "java-output-path" value="/jngl_mysql/web-inf/classes"/>
- </wb-module>
- </project-modules>
Then there is the. jsdtscope file, which remembers to change your output path.
[HTML]View PlainCopyprint?
- <? XML version= "1.0" encoding="UTF-8"?>
- <classpath>
- <classpathentry kind="src" path="WebRoot"/>
- <classpathentry kind="Con" path="Org.eclipse.wst.jsdt.launching.JRE_CONTAINER" />
- <classpathentry kind="Con" path="Org.eclipse.wst.jsdt.launching.WebProject">
- <attributes>
- <attribute name="Hide" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="Con" path="Org.eclipse.wst.jsdt.launching.baseBrowserLibrary" />
- <classpathentry kind="Output" path= ""/>
- </classpath>
5. Right-click on the Eclipse project to refresh the project.
6, right-click on the project, enter the property (properties)
7, click on the list item on the left to select "Project Facets", on the right side to see not the "Dynamic Web Module" and "Java", if there is a success, if not, select.
Import eclipse from MyEclipse, not recognized as a Web project (Java Project to Web project)