Workaround for the Src/main/java Resource folder cannot be established after Eclipse builds the MAVEN project

Source: Internet
Author: User

After the new good one MAVEN project is established, if there is no Src/main/java folder under the Java Resources Resource file, and you are prompted to "file already exists" When you manually create the file.

This shows that in this project configuration already has Src/main/java this folder, as for why not show, I am still not clear, hope who understand with me under, thanks. (resolved) The first method: Open the project's Classpath file, as follows:
<?XML version= "1.0" encoding= "UTF-8"?><Classpath>    <ClasspathentryKind= "src"Output= "Target/test-classes"Path= "Src/test/java">        <attributes>            <attributename= "Optional"value= "true"/>            <attributename= "Maven.pomderived"value= "true"/>        </attributes>    </Classpathentry>    <ClasspathentryKind= "src"Path= "Src/main/java"/>    <ClasspathentryKind= "src"Path= "Src/main/resources"/>    <ClasspathentryKind= "src"Output= "Target/test-classes"Path= "Src/test/resources"/>    <ClasspathentryKind= "Con"Path= "Org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">        <attributes>            <attributename= "Maven.pomderived"value= "true"/>            <attributename= "Org.eclipse.jst.component.dependency"value= "/web-inf/lib"/>        </attributes>    </Classpathentry>    <ClasspathentryKind= "Con"Path= "org.eclipse.jdt.launching.jre_container/org.eclipse.jdt.internal.debug.ui.launcher.standardvmtype/ JavaSE-1.6 ">        <attributes>            <attributename= "Owner.project.facets"value= "Java"/>        </attributes>    </Classpathentry>    <ClasspathentryKind= "Output"Path= "Target/classes"/></Classpath>

The Path property will appear as: Src/main/java's Classpathentry node, at which point we need to delete the newly created node, such as <classpathentry kind="src" path= " Src/main/java "/>. If you re-establish the Src/main/java folder under Java Resources, there will be no problem.

The second method: This is the most convenient one. On the project, right-select Properties, then click Java Build Path, under Librarys, edit the JRE System Library, select workspace Default JRE.

Workaround for the Src/main/java Resource folder cannot be established after Eclipse builds the MAVEN 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.