IntelliJ will offer the opportunity to create a new class in the new menu only if you right-click inside the part of the project structure that is marked as the root directory of sources or source roots.
In your case, right-click the src/main directory in the project structure view and select "Mark As / Sources Root Directory". That should fix it.
In addition, Gradle expects Java classes to be placed in src/main/java (and check Java classes in src/test/java ) by default. I think that if you followed this convention, IntelliJ would automatically label these folders as (Test) Sources Root. Therefore, perhaps it would be the best solution to customize the project structure in accordance with this agreement.
Here is a quote from the Gradle guide regarding this issue:
Gradle expects to find the source code of your production in src / main / java and your test source code in src / test / java
Bohuslav burghardt
source share