'Exception in thread "main" java.lang.NoClassDefFoundError' when running java program from command line
<p>What am I doing wrong here: </p>

<pre><code>class Helo { 
   // main: generate some simple output 
   public static void main (String[] args) { 
      System.out.println ("Hello, world."); // print one line 
      System.out.println ("How are you?"); // print another 
   } 
} 
</code></pre>

<p>When I go into terminal I do: </p>

<pre><code>cd ~
javac Atempt2.java (//that's the file name) 
java Atempt2 
</code></pre>

<p>and then it gives me this error message: </p>

<pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: Atempt2
</code></pre>

<p>So all in all this is what I do and what happens: </p>

<pre><code>david-allenders-macbook-pro:~ davidallender$ cd ~
david-allenders-macbook-pro:~ davidallender$ javac Atempt2.java
david-allenders-macbook-pro:~ davidallender$ java Atempt2
Exception in thread "main" java.lang.NoClassDefFoundError: Atempt2
david-allenders-macbook-pro:~ davidallender$ 
</code></pre>

<p>I am very new at this so please explain things in a very simple manner. </p>

<p>Thanks. </p>
