Home > Software design >  Intellij : Package name does not correspond to the file path
Intellij : Package name does not correspond to the file path

Time:06-10

I have a Java/Maven project in intellij with the following file structure :

My directory structure

And the following line get me the error " Package name 'test.java.princ' does not correspond to the file path 'princ'"

Line with the error

In fact, it does this with every files in my project.

What I've tried :

  • Rebuilding with maven
  • Deleting project and importing it again
  • Unmarking src/resources folder and marking them again
  • supervision.iml has the correct folders as src and resources

Building works fine, with intellij or mvn command.

CodePudding user response:

you should not need the main.java just do package princ... for example: Model.test for this project layout: Project Structure. this gives me no errors.

  • Related