Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating two package inside one package in intellij

I'm working on Intellij IDEA about java project. However, I see a problem when I want to create new packages.So, my problem is:

>Package1
 >Package2 // (there is a problem in here)
  >Package3 

When I want to create third package, it shows Package2.Package3, but my expected look like:

>Package1
 >Package2 
  >Package3 

Is there any way to make that?

like image 270
Daymnn Avatar asked Oct 20 '25 07:10

Daymnn


2 Answers

In Project tab (left side) you can find a settings like icon called Show option menu.. Inside this menu turn off the Flatten Packages

You can also uncheck/turn off the Compact Middle Packages just below it, that did it for me

like image 76
CK1 Avatar answered Oct 22 '25 22:10

CK1


If you examine the actual folder structure, you will in fact see that folder Package2 has a subfolder called Package3. IntelliJ is just displaying things this way as an abbreviation. If you add something else to Package2, e.g. another folder or a file, you should no longer see the entry Package2.Package3, but rather you should see the folder structure you expect.

like image 25
Tim Biegeleisen Avatar answered Oct 22 '25 23:10

Tim Biegeleisen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!