title: NoClassDefFoundError when running program
body: <p>I have a problem that I know has been asked a lot on here, but all of the posts I've found before (and I've found a lot of them) aren't working for me.</p>
  
  <p>I have a basic Java program that I've uploaded to a server. When I log into the server via SSH, the .java file is in my home directory. I compile it on the server and confirm that the .class file is generated.</p>
  
  <p>But when I try to run the program using </p>
  
  <pre><code>java &lt;program name&gt;
  </code></pre>
  
  <p>it gives me the error.</p>
  
  <p>What have I tried?</p>
  
  <ul>
  <li>Creating a subdirectory with both files in it</li>
  <li>Invoking the program with the package name (i.e. java packagename.programname)</li>
  <li>Compiling it off of the server and then transferring both on</li>
  <li>Explicitly set the class path using -cp</li>
  </ul>
  
  <p>What's really weird is that I took another program and was able to compile and run it without a problem, even though it's essentially the same program (I copied and pasted portions into mine).</p>
  
  <p>I can include parts of the code here if needed, though I'll need to be told exactly which parts are needed, as there are quite a few lines.</p>