title: ClassNotFoundException in IntelliJ IDEA
body: <p>I have received an IntelliJ project from someone else, but it won't run even the simplest classes for me.</p>
  
  <p>As a quick example, the following class will throw a <code>ClassNotFoundException</code> without compiler errors:</p>
  
  <pre><code>package myPackage;
  
  public class Main {
      public static void main(String[] args)  {
          System.out.println("Hello World!");
          System.out.println("Soon our GUI will start from here!");
          System.exit(0);
      }
  }
  </code></pre>
  
  <p>This will throw the following error:</p>
  
  <pre><code>Exception in thread "main" java.lang.ClassNotFoundException: myPackage.Main
  at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:260)
  at com.intellij.rt.execution.application.AppMain.main(AppMain.java:116)
  
  Process finished with exit code 1
  </code></pre>
  
  <p>The file structure is as follows:
  <code>&lt;git root&gt;</code>/<code>src</code>/<code>myPackage</code>/<code>Main.java</code></p>
  
  <p>I have set the 'src' folder as the 'source folder'. My application has no compiler errors. 
  I have invalidated the caches several times, but with no effect whatsoever. 
  In my module settings my module dependencies contain <code>&lt;Module source&gt;</code> and jdk 1.8.</p>
  
  <p>I can't seem to find the answer around here (google) anywhere, and to me it seems like this error has to do with the way IntelliJ handles the project. When I first pulled the project, the <code>src</code> folder had NOT been set to be the source folder, which probably means I may be missing out on other settings as well. </p>