title: How to resolve ClassNotFoundException when the class is there?
body: <p>Here is my code</p>
  <pre><code>package vista;
  
  public class MyMainClass
  {
      public static void main(String[] args) 
      {
          try
          {
              if(1&gt;0) throw new MyException(&quot;ERROR&quot;);
          }
          catch(MyException err)
          {
              System.out.println(err.toString());
          }
      }
  }
  </code></pre>
  <hr />
  <pre><code>package vista;
  
  public class MyException extends Exception
  {
      // Constructor.
      public MyException(String errMsg)
      {
          super(errMsg);
      }
  }
  </code></pre>
  <hr />
  <p>Output:</p>
  <pre><code>Error: Unable to initialize main class vista.MyMainClass
  Caused by: java.lang.NoClassDefFoundError: vista/MyException
  Command execution failed.
  </code></pre>
  <hr />
  <p>Both classes are in the same <code>\vista</code> folder, and before excecution NetBeans recognizes this. How do I resolve this?</p>
  <hr />
  <p>Edit: while not running but just compiling the program I realized NetBeans was attempting to download some files. I turned my firewall off, ran the program, it downloaded some files, and now it excecutes properly.</p>