title: Java run time error - java.lang.NoClassDefFoundError wrong name
body: <p>When I try to run my code from the command line, I get the following exception error;</p>
  
  <pre><code>    X:\User temp\httpclient&gt;java httpclient_main 10 10
  Exception in thread "main" java.lang.NoClassDefFoundError: httpclient_main (wron
  g name: httpclient/httpclient_main)
          at java.lang.ClassLoader.defineClass1(Native Method)
          at java.lang.ClassLoader.defineClass(Unknown Source)
          at java.security.SecureClassLoader.defineClass(Unknown Source)
          at java.net.URLClassLoader.defineClass(Unknown Source)
          at java.net.URLClassLoader.access$100(Unknown Source)
          at java.net.URLClassLoader$1.run(Unknown Source)
          at java.net.URLClassLoader$1.run(Unknown Source)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
  </code></pre>
  
  <p>httpclient_main.java;</p>
  
  <pre><code>/*
   * To change this template, choose Tools | Templates
   * and open the template in the editor.
   */
  package httpclient;
  
  import java.io.DataInputStream;
  import java.io.DataInputStream;
  import java.io.DataOutputStream;
  import java.io.IOException;
  
  /**
   *
   * @author tsothcott
   */
  public class httpclient_main {
      protected String host;
      protected String file;
      protected int port;
      protected DataInputStream in;
      protected DataOutputStream out;
      static double threadResult;
  
      String get_file()
      {
          return this.file;
      }
      DataOutputStream get_outputstream() {
          return this.out;
      }
  
      public static void main(String[] args) throws IOException {
          InputTxt servers = new InputTxt();
          threadResult = 0.0D;
  
          SharedCell cell = new SharedCell();
          if(args.length &lt;1)
              throw new IOException("Usage: HTTPClient URL Number_Thread");
  
          int num_thread = Integer.parseInt(args[0]);
          int count_interval = Integer.parseInt(args[1]);
  
          servers.printservers();
  
          Manufacture prod = new Manufacture(cell, num_thread, count_interval);
          prod.start();
  
  
      }
  
  
  }
  </code></pre>
  
  <p>Screenshot of project structure;
  <img src="https://i.stack.imgur.com/Ljzyj.png" alt="Project Structure"></p>
  
  <p>Howewver, when I run it from inside NetBeans, it runs fine? </p>
  
  <p>Any help would be appreciated!</p>
  
  <p>Thanks</p>