After extensive research through Google, Stackoverflow and peers I am still unable to solve the below stated issue.
IntelliJ is unable to locate any main class of whatever file I choose:
Error: Could not find or load main class nl.sam.inventory.InventoryApplication
I have followed the answer which was posted on SO: Error "ClassNotFoundException" in IntelliJ IDEA
My main class:
package nl.sam.inventory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class InventoryApplication {
public static void main(String[] args) {
SpringApplication.run(InventoryApplication.class, args);
}
}
My run settings are left as default (IntelliJ picked these up).
My project structure: Project Structure
If I left anything out please state so.
I have verified I have a JRE (11) and JDK (11) installed and working on my machine. In a terminal the program runs just fine: in IntelliJ I get the aforementioned error.
Edit: I use Maven for project management. A project without maven shows the same behaviour.