title: "Could not find or load main class" when trying to run Java program from Mac Terminal
body: <p>I was trying to run a basic Hello World program written in Java using my the Mac Terminal. It gave me an error that said:</p>
  
  <pre><code>"Could not find or load main class". 
  </code></pre>
  
  <p>The commands that I used to try and run the program were as followed (after I used cd to go to the directory where HelloWorld.java was located):</p>
  
  <pre><code>javac HelloWorld.java
  java HelloWorld 
  </code></pre>
  
  <p>I did some searching and tried using "java -cp . HelloWorld" but no matter what I try, I always get the "Could not find or load main class" error. The code compiles and runs just fine in Eclipse, but I'm wondering what could be the cause of it not working in the Terminal? </p>
  
  <p>My Java version is 1.8.0_20 running on OS X 10.9.5 if that makes any difference. </p>