Eclipse+Maven src/main/java not visible in src folder in Package Explorer

前端 未结 16 2109
情深已故
情深已故 2020-12-23 09:19

I\'m wondering why I can\'t see following folders in src node in Package Explorer

src/main/java
src/main/resources
src/test/java
src/test/resources
         


        
16条回答
  •  情深已故
    2020-12-23 09:30

    I had a similar issue when I checked out a web project from a github repo on my eclipse. src/main/java was directly inside the project root in Package Explorer. My expectation was that src/main/java be visible inside a source folder "Java Resources". There were few things which I did to achieve this.

    1. Right click on Project > Build Path > Configure Build Path..
    2. Select filter "Java Build Path" and click on Tab "Libraries" Verify your "JRE System Library". If it is not pointing to your latest JDK, then you can click on Edit Button and follow the subsequent dialog boxes to select most appropriate JDK home path in your system. Once done click Apply, Apply and Close, Finish to close all the associated open boxes for the current filter.
    3. Select filter "Java Compiler" and ensure your JDK Compliance points to correct JDK. Click Aapply
    4. Select filter "Project Facets". Ensure both Java and Dynamic Web Module is selected with correct version.
    5. Click Apply and Close.
    6. Source folder "Java Resources" gets created with src/main/java in it when viewed in Project Explorer.

提交回复
热议问题