2
I am using Intellij IDEA to program in Java and want to create several packages inside each other, where each of them will contain classes and other file types.
The problem is that when creating packages by IDEA, they stick together in the directory tree, it being impossible to create a class .java
in the previous package. Example:
veiculo.carro.roda
I would like to create a class in the package carro
but I cannot therefore, the packages stay together and IDEA always creates the class in the last package, which in this case would be the package roda
.
Image of my Intellij IDEA (I’m using the latest version of 2017):
What should I do to separate package names from the directory tree or create a class in a package that is not the last?
Thank you, I did not find the button of the first option but the second option helped me a lot and even made the tree of directories more beautiful <3
– JeanExtreme002
@Jeanextreme002 I have version 2019.3.4 Community Edition, and the "Compact Middle Packages" option only appears in the menu if "Flatten Packages" is unchecked (if I check Flatten, Compact some)
– hkotsubo
Anyway, I don’t know if there’s any difference to older versions..
– hkotsubo