package in .java file makes class file unuseable
<p>It's been too long since I've last done Java, and I can't remember why the following happens:</p>

<p>Given this file, created by a standard Maven project, as can be seen here: <a href="http://maven.apache.org/guides/getting-started/index.html" rel="nofollow">Maven Tutorial</a></p>

<pre><code>package com.mycompany.app;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        System.out.println( "Hello World!" );
    }
}
</code></pre>

<p>Compiling this, not even with Maven but with the standard javac executable, will generate a class file without errors. Try to run the class file, and you get this error:</p>

<pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: App (wrong name: com/mycompany/app/App)
</code></pre>

<p>Remove the package command, compile again and it runs just fine. Why is this? I'm running JDK 1.6.0_21 btw.<br></p>
