Background/Situation
There is no option to create a regular directory in a Java project in packages and sources root folders. The only options available are package and Python Package:
Question
How to create a simple directory – not a package?
Answer
This is because the parent folder is marked as sources root (as Java files contain a source code that should be compiled, the folder with the code should be marked as sources root). Since the IDE recognizes this folder as a sources folder, it will allow creating only packages for the source files.
Note: Packages are essentially folders, so creating a new package in the IDE will create a new folder in the project tree.
Possible solutions
-
Create a regular folder in a directory that is not marked as sources root or a package (solid grey)
-
Right-click on the blue folder or a package -> Open in -> Explorer, then create a new folder in the system manually, and switch back to the IDE
-
Right-click on the project name in the Project view -> New -> Directory, then provide a full relative path to the folder, e.g.
src/main/new-folder
Comments
0 comments
Please sign in to leave a comment.