title: How to run a NetBeans project in command prompt?
body: <p>My professor asked us to create a Java program that would be able to run in command prompt but could also be opened using NetBeans.</p>
  
  <p>The program is about using the different types of sorting (specifically Selection, Insertion, Exchange, Quick, and Heap sorting). our professor specifically told us to use object oriented programming in Java, and that she wants to see a main class plus the different classes that would do the sorting.</p>
  
  <p>I tried to write the program in NetBeans — thinking that later I could simply run the program in cmd using javac.</p>
  
  <p>In cmd, I typed the path where my NetBeans project was saved and I tried to compile the files using javac. but it says that "'javac' is not recognized as an internal or external command, operable program or batch file."</p>
  
  <p>So I tried to save the files in sun>sdk>jdk>bin, and from there I tried to compile the files, and it was fine. The problem sets in when I tried to run them.</p>
  
  <p>Here's how I tried to compile the files:</p>
  
  <pre><code>javac Main.java
        Sortchoice.java
        Selection.java
        SelectionSort.java
        Insertion.java
        InsertionSort.java
        Exchange.java
        ExchangeSort.java
  </code></pre>
  
  <p>(I havent finished the syntax for the next two sorting.)</p>
  
  <p>Here's how I tried to run the files in cmd:</p>
  
  <pre><code>java Main Sortchoice Selection SelectionSort Insertion InsertionSort Exchange ExchangeSort
  </code></pre>
  
  <p>and cmd says:</p>
  
  <pre><code>exception in thread "main" java.lang.NoClassDefFoundError: main (wring name: myjava/Main)
  at java.lang.ClassLoader.defineClass1(Nativ... Method)"
  at java.lang.ClassLoader.defineClass(ClassL...
  at java.security.SecureClassLoader.defineCl...
  at java.net.URLClassLoader.defineClass(URLC...
  at java.net.URLClassLoader.access$000(URLCl...
  at java.net.URLClassLoader$1.run(URLClassLo...
  at java.security.AccessController.doPrivile... Method)
  at java.net.URLClassLoader.findClass(URLCla...
  at java.lang.ClassLoader.loadClass(ClassLoa...
  at sun.misc.Launcher&amp;AppClassLoader.loadCla...
  at java.lang.ClasLoader.loadClass(ClassLoad...
  at java.lang.ClassLoader.loadClassInternal(...
  </code></pre>
  
  <p>What should I do? (Sorry for my kilometric-long explanation. I just wanted to put in as many details as possible.)</p>
  
  <p>I would also like to emphasize that I'm just a beginner in Java programming.</p>