Package name does not correspond to the file path – IntelliJ

Judging from the directory structure, you have two packages client and server, but the code expects packages badugi.client and badugi.server.

Here is a way to fix it:

  1. Position your cursor to the underlined package statement (package badugi.server)
  2. Hit ALT + ENTER
  3. Select option Move to package badugi.server. This will automatically fix your directory structure to match the declared package

or

  1. Right click src in Project explorer
  2. Select New/Package and create package badugi
  3. Select client and server packages and drag them to the badugi package

Leave a Comment