title: Receiving "wrong name" NoClassDefFoundError when executing a Java program from the command-line
body: <p>I have a problem while trying executing my java application.
  Whenever I try to execute the program through the command </p>
  
  <pre><code>java ProgAudioJ
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>Exception in thread "main"
  java.lang.NoClassDefFoundError: ProgAudioJ (wrong name: es_2011/ProgAudioJ)
          at java.lang.ClassLoader.defineClass1(NativeMethod)
          at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
          at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
          at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
          at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
          at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
          at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
          at java.security.AccessController.doPrivileged(NativeMethod)
          at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
          at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
  Could not find the main class: ProgAudioJ.  Program will exit.
  </code></pre>
  
  <p>If I remove from my code:</p>
  
  <pre><code>package es_2011;
  </code></pre>
  
  <p>Everything works perfectly. How do I solve the problem?</p>