“Module not specified” Error in IntelliJ.

This happened after I renamed the modules to more descriptive logical names in IntelliJ 2018.3, Ultimate Edition. As a result, my two Maven module folders were no longer marked as modules in IntelliJ (no blue square in the bottom right corner of the folder icon in the Project panel). To solve the issue, I did the following:

  1. ”Unmark” any resources, java or test folders in each module folder (“Right click/Cmd+click, choose “Mark Directiry As”).
  2. Go to File > Project Structure, select Modules under Project Settings.
  3. Click the Copy icon (next to the + and – icons).
  4. In the Copy Module dialog that pops up, select the source folder for your module under “Module file location”, click OK.
  5. Open your Run Configuration screen. If “Use classpath of module” still only offers “no module”, back up any of your Run Config settings & options, then delete the old configuration and Add New Configuration (+ icon).