[SOLVED] Cannot create package/ Java class in Intellij IDEA with Maven template

Intellij IDEA Community Edition 15.0.2 (latest)

Whenever I try to create with Maven, I seem to be unable to create a Package nor Java class. However creating a blank Java project allows me to proceed as normal. However, I (had to) download the Sponge API jarfile and add it as a dependency manually instead of grabbing it directly from the repo. I seem to be missing some things (such as org.spongepowered.api.service.command.CommandService) and some are out of place (such as org.spongepowered.api.service.command.* being located at org.spongepowered.api.command.*).

Are you checked “Create directories for empty content roots automatically” when creating project?

There is no option for that. Keep in mind that I am using Intellij IDEA and not Oracle's software.

Oh, my bad. I confused it with Gradle project.
You can mark any folder in project as Source folder with right click → Mark directory as → Sources root.

1 Like

Thanks somuch! Got my problem resolved. Though I question why Intellij IDEA did not configure the folder automatically.

Yeah Maven doesn’t do that nearly as well.

I would HIGHLY RECOMMEND using gradle, as it has maven dependency capabilities but is also a powerful build script tool.

2 Likes