Creating a src/main/java folder structure in Eclipse without Maven

前端 未结 8 1547
醉酒成梦
醉酒成梦 2020-12-12 15:24

How do I create the src/main/java and src/test/java in my default web application project in Eclipse without Maven? My current folder structure is

相关标签:
8条回答
  • 2020-12-12 15:57

    I have solved this issue by below steps:

    Right click the Maven Project -> Build Path -> Configure Build Path In Order and Export tab, you can see the message like '2 build path entries are missing' Now select 'JRE System Library' and 'Maven Dependencies' checkbox Click OK

    0 讨论(0)
  • 2020-12-12 16:01

    Open Properties > Java Build Path for the project. Select the Source tab and use Add Folders to add source folders.

    0 讨论(0)
  • 2020-12-12 16:02

    the problem will be solved by checking on 'JRE System Library' and 'Maven Dependencies' checkboxs Click OK. this is found in the project's 'build path option'

    0 讨论(0)
  • 2020-12-12 16:08

    Simple solution would be create 'java' folder directly one the drive into src/main even before opening it in eclipse that way eclipse will not complain about the issue.

    0 讨论(0)
  • 2020-12-12 16:17

    Remove the actual source folder definition in the build path and add a new source folder an name it src/main/java

    0 讨论(0)
  • 2020-12-12 16:19

    As you've discovered, you can't have a source folder inside another source folder, so before you can create src/main/java you have to tell Eclipse not to treat src as a source folder. To do this, right click on the src folder and select build path -> remove from build path.

    Once you have done this src will appear in the folder tree in its normal place, so you can create the main and java folders under it, and move the existing src/com to src/main/java/com. Finally right-click the newly-created java folder and select build path -> use as source folder.

    0 讨论(0)
提交回复
热议问题