How are you compiling this, and how are you referencing the main class?
If you're using a package manager like
Maven, you can have Maven specify the main class like this:
If you're using built-in IntelliJ functions to specify the main class, you'll have to update those whenever you change the pathname of the main class
If using raw javac commands - ensure that you're typing the fully qualified classname. To do this, type "packageName.mainClass" for example.