Create new package in IntelliJ

Follow these steps:

  1. First set the folder as a "Sources Root" by right clicking and navigating to "Mark directory".

  2. Right click on the same item

  3. Select "New" → "Package"

In my case, I was not able to see the create new package option.


Disable Compact Empty Middle Packages option in the Project View:

compact

You will now see admin as a separate node and will be able to create a new package inside it.


You can follow these steps:

  1. Select the package from Project Pane

  2. Double click the relevant section from the breadcrumb. Then it will get selected.

  3. Right click on the same item

  4. Select "New" → "Package" from the menu

    enter image description here