Mar
Mar

Reputation: 443

Cant create new directory inside existing directory in IntelliJ

Im using IntelliJ community version for Spring project, and I have issue with creating new directory named images inside already existing directory resources -> static. When I right click on static and I add new directory images, instead of creating new directory this is created.

enter image description here

Someone could say that it is ok, this is a way new directory is shown, but I dont think that is correct. When I try to remove images directory I can remove only both directories static.images directory. If I try to add new directory into static directory, it goes into static.images and not into static.

enter image description here

So question is how to create directory inside another directory? There is no issue when I add new package inside another package in the src->main->java project structure.

Upvotes: 3

Views: 2643

Answers (2)

user26460482
user26460482

Reputation: 11

You just need open Project (where displayed your project's structure), then Options -> Tree Appearance -> uncheck Compact Middle Packages

Upvotes: 1

Mike Slinn
Mike Slinn

Reputation: 8403

The other person is correct. The directory was created as you desired, it is just displayed differently that you expected.

To verify this, open a shell and list the directories. The following shows all the directories under the current directory.

$ find . -type d

The directory parent is based on where in the path you click. If you click on the word static you will create a directory under the static directory. If you click on the word images you will create a directory under the images directory.

Upvotes: 0

Related Questions