8

Not sure how to really ask this question since I don't know what everything is called but I'll try to do the best I can.

So as I was cleaning up my classes. I right clicked my project and selected refresh. Then all of a sudden my project view changed, the src folder shows everything as packages and '.' separated subpackages. And all my code package declarations seems now to be undiscoverable.

I've attached a photo, hopefully you can petter understand this...How can I fix this to have the correct directory view/structure.

Edit:

Here is what I have linked to my JAVA build path

I don't understand what is happening? How can all of a sudden my project screw up like it has? Any help will be much appreciated

6 Answers 6

12

Look at the 'Java Build Path' in the project 'Properties' and check that you have the correct 'Source' folders. It looks like you may have just 'src' as a source folder when you should have 'src/main/java', 'src/test/java'...

Sign up to request clarification or add additional context in comments.

1 Comment

I first had to do @mosawi's answer with the Maven>update project, and then I did the above steps
7

I was able to fix this by maven>update project, then just refresh...

Comments

4

In addition to the previous answer you also may use empty package filter: At the top-right of the Package Explorer view, there's a downward-pointing triangle. If you hover your mouse pointer over it you'll see View Menu.

Click the View Menu, select Filters, put a check next to Empty Packages, then click OK. Same way you could tune other options for Package explorer such as file types to show etc.

Comments

0

Well, it seems pretty clear that your hierarchy does not match the name of your package, so just fix your hierarchy. It will be easier if you switch to the hierarchical view of the packages. To do so, go to Package explorer, View menu (arrow icon pointing to the bottom), Package presentation, Hierarchical.

Comments

0

The following worked for me:
Right Click on src (which is shown like empty package in my project) -> Build Path -> Use As Source Folder

Comments

0

You can set/update package structure from Build Path 1

2

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.