Importing eclipse from myeclipse cannot be identified as a web project (a Java project is converted to a web project)

Source: Internet
Author: User

1. Go to the project directory, find the. project file, and open it.

2. Find the <natures>... </natures> code segment.

3. Add and save the following TAG content to the code snippet in Step 1:

<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. setting files, from other eclipsejee web projects [remember to use eclipse to create a new one] for the sake of security. copy the following files under the setting file [copying the entire folder]
. 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 in org. Eclipse. WST. Common. component.

For example, change jngl_mysql to your project name.

Then, WB-resource is your resource file. The default value is SRC. If Maven is used, it may be src/Java/Main, src/Java/resource. Remember to add.

<?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. Remember to change your output path.

<?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 the Eclipse project and refresh the project.

6. Right-click the project and choose Properties)

7. Click "project facets" in the list project on the left, and check that "dynamic web module" and "Java" are not selected on the right. If yes, the operation succeeds. If not, select the project.

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.