title: Why I can't run my compiled Java file ? (.class)
body: <p>I have compiled two files in out folder (<a href="https://i.stack.imgur.com/SMIBv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SMIBv.jpg" alt="image" /></a>, <a href="https://i.stack.imgur.com/uaYwM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uaYwM.png" alt="second image" /></a>)</p>
  <p>Code in Main.java (source file from Main.class) is:</p>
  <pre><code>import gui_pckg.Gui;
  public class Main {
      public static void main(String[] args) {
          Gui gui = new Gui();
      }
  }
  </code></pre>
  <p>Code from Gui.java (source file from Gui.class) is:</p>
  <pre><code>package  gui_pckg;
  import javax.swing.*;
  import java.awt.*;
  public class Gui { 
      public JFrame frame = new JFrame(&quot;To Do List&quot;);
      public Gui() {
          frame.setSize(500, 800);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setVisible(true);
      }
  }
  </code></pre>
  <p>Im trying to run it with cmd (Windows 10) I'm typing:</p>
  <pre><code>C:\Users\jindr&gt;cd C:\Users\jindr\Desktop\todolist\out
  
  C:\Users\jindr\Desktop\todolist\out&gt;java Main
  </code></pre>
  <p>And it throws error:</p>
  <pre><code>Error: Could not find or load main class Main
  Caused by: java.lang.ClassNotFoundException: Main
  </code></pre>
  <p>My Java Classpath is not broken!</p>