Why is my Eclipse Java package being treated as a folder?

后端 未结 14 848
失恋的感觉
失恋的感觉 2021-01-04 00:14

My Eclipse Java package is treated as a folder; can anyone suggest what\'s wrong?

14条回答
  •  粉色の甜心
    2021-01-04 00:38

    I have faced the same issue and found the solution, as to add Java Nature in .project file of the current application.


    Project natures are used in the Eclipse IDE in order to configure projects in the workspace. One project may have several project natures. The most popular project nature is org.eclipse.jdt.core.javanature, which is used to indicate that a project is a Java project.

    Add org.eclipse.jdt.core.javanature and its corresponding builder in the .project file of an application as shown below:

    
        MyJavaApplication
        
        
        
            
                org.eclipse.jdt.core.javabuilder
                
            
            
        
        
            org.eclipse.jdt.core.javanature
            
        
    
    

    Project view as Package structure:

    enter image description here

    Projects and its dependent modules as Hierarchical structure.

    Package Explorer / View Menu / Package Presentation... / Hierarchical
    

提交回复
热议问题