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

后端 未结 14 647
失恋的感觉
失恋的感觉 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:37

    Well, I actually think you might don't even need the answer anymore (almost two years later) but I will share anyway to document (just found a solution that others could use).

    The problem: while searching some packages I accidentally clicked "Add to build path" in a package and after I ctrl+z, the package had became a folder.

    The solution I found was on the .classpath. There was a line there with the name of the package I had just added to the build path (even after the Ctrl+Z). Delete that line and after refreshing the project your whole src folder will be turned into a normal folder.

    Then right click your src, following this path: src > Build Path > Use as Source Folder.

    This solved the problem, I just tested the result. Hope it helps.

提交回复
热议问题