Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse: how to make directory trees show as packages

Tags:

In a typical project of mine, I have several source directories, each with the usual special icon in the package explorer.

Since these are maven projects, some are full of Java code, and some are full of resources.

Some of the resource trees show the subdirs as packages, but others just show them as folders.

Anyone know how to get them all to show as packages?

like image 1000
bmargulies Avatar asked Dec 30 '10 01:12

bmargulies


People also ask

How do I show packages in Eclipse?

Upon running Eclipse you should see a pane labeled 'Package Explorer', probably on the left. If you do not see one, you can open it up by going to the Window menu, selecting Show View and Package Explorer. If it doesn't show up under Show View, select Other, then 'Java', then 'Package Explorer'.

How do I open a folder tree in Eclipse?

Eclipse offers the Navigator view which will display your project in the way you are asking. To open this view select Window > Show View > Navigator .

How do I show folders in Eclipse?

To view the project explorer, click on Window menu then, click on Show View and select Project Explorer. There is simpler way to open project explorer, when you are in the editor press alt + shift + w and select project explorer.


1 Answers

In the Package Explorer, right-click on the folder and choose Build Path / Use As Source Folder. The contents of that folder will now be included in the Eclipse build, however.

Edit

If it is a nested folder, it has probably been excluded from the build. If so, you can choose Build Path / Include -- but once again it will now be part of the build. An included subfolder can be excluded again using Build Path / Exclude.

like image 150
WReach Avatar answered Oct 02 '22 17:10

WReach