Create Mave Web project, default only Src/main/resources folder, create Src/main/java source Floder, report the folder is already a Sour__web

Source: Internet
Author: User

Problem Description:

Create MAEVN Web project, after selecting Maven_archetype_web prototype, default only src/main/resources this source floder.  According to the MAVEN directory structure, add source floder such as Src/main/java, Src/test/java, and display the folder is already a source folder. Cannot add

from the Internet to check some information, summed up the following several methods:

Workaround:

The first method: Open the. classpath file for the project:


The Path property appears as: Src/main/java classpathentry node, then delete the node we need to create, such as <classpathentry kind= "src" path= "Src/main/java" />. Re-establish the Src/main/java folder under Java resources, and there is no problem.

But complete the steps above, return to eclipse click Maven---->update projects, the project error, the original Src/main/resources No, this has added Src/main/java, refresh also not, And back to the Classpath file found only one Src/main/java classpathentry. Then the original Classpath file restore process to the beginning, the project update, the result is, very strange, do not understand how to get


The second method:

Right-key project build path-> Configure build path-> source, select Src/main/java, Src/test/java Delete, and then new.


The third type:

Use the Navigator view to create a Java directory directly under the Src/main directory.

Analysis Reason: Project Properties->java build Path->source, you will see Src/main/java, Src/test/java already exist, but missing. So you just need to create a directory, and Source Floder appears.

The fourth kind:

This is the most convenient one. Right-click on the item to select Properties, then tap Java build Path, under Librarys, edit the JRE System Library, select the workspace default JRE.

Note: The above summarized LZ only used the first kind to solve, the back has not tried ....

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.