title: Intellij "Could not find or load main class"
body: <p>I installed intellij and it keeps giving me error: </p>
  
  <pre><code>Could not find or load main class sample.Main
  </code></pre>
  
  <p>I checked many answers for similar questions and non of them worked. The program I'm trying to run:</p>
  
  <pre><code>package com.company;
  
  public class Main {
  
      public static void main(String[] args) {
          System.out.printf("hello");
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/jcgxm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/jcgxm.png" alt="enter image description here"></a></p>
  
  <p>Run Configuration
  <a href="https://i.stack.imgur.com/kkvou.png" rel="noreferrer"><img src="https://i.stack.imgur.com/kkvou.png" alt="enter image description here"></a></p>
  
  <p>Settings
  <a href="https://i.stack.imgur.com/saffJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/saffJ.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/e8NSI.png" rel="noreferrer"><img src="https://i.stack.imgur.com/e8NSI.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/LuTHD.png" rel="noreferrer"><img src="https://i.stack.imgur.com/LuTHD.png" alt="enter image description here"></a></p>
  
  <p>"out" folder is not getting created. Full run command used by intellij after expanding "..."</p>
  
  <blockquote>
    <p>"C:\Program Files\Java\jdk1.8.0_181\bin\java.exe"
    "-javaagent:E:\Program Files\JetBrains\IntelliJ IDEA Community Edition
    2018.2.1\lib\idea_rt.jar=51072:E:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.1\bin" -Dfile.encoding=UTF-8 -classpath
    "C:\Program Files\Java\jdk1.8.0_181\jre\lib\charsets.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\deploy.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\ext\access-bridge-64.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\ext\cldrdata.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\ext\dnsns.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\ext\jaccess.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\ext\jfxrt.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\ext\localedata.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\ext\nashorn.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\ext\sunec.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\ext\sunjce_provider.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\ext\sunmscapi.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\ext\sunpkcs11.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\ext\zipfs.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\javaws.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\jce.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\jfr.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\jfxswt.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\jsse.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\management-agent.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\plugin.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\resources.jar;C:\Program
    Files\Java\jdk1.8.0_181\jre\lib\rt.jar" com.company.Main</p>
  </blockquote>