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 ....