title: Class Not Found even when specifying full package path
body: <p>I'm trying to use a third-party package (call it 'foo.bar'). It's in a jar file in the current directory (foo.bar.jar). I'm trying to run the following super basic "hello-world"-style program:</p>
  
  <pre><code>package foo.bar.bla;
  import foo.bar.*;
  import foo.bar.somethingelse.SomeException;
  
  public class HelloWorld implements SomethingInFooBar {
  
      public static void main(String[] args) throws SomeException {
          System.out.println("Hello World!");
      }
  }
  </code></pre>
  
  <p>It compiles just fine when I use <code>javac -cp foo.bar.jar HelloWorld.java</code>.</p>
  
  <p>But when I try to run it (using <code>java HelloWorld</code>), I always get <code>NoClassDefFoundError (wrong name)</code> error, along with a <code>/</code>-separated package path (<code>some/path/like/this/HelloWorld</code>) of where the class ostensibly lies. But when I try to run it with the full path (as mentioned in other questions and on other sites addressing this problem), it still doesn't work (using the command <code>java path.it.gave.me.HelloWorld</code>).</p>
  
  <p>Thanks for any insight into this n00b problem. I should stop relying so much on Eclipse!</p>