Class declaration bug (NoClassDefFoundError caused by ClassNotFoundException)
<p>Please advise me what's wrong with this class declaration:</p>

<p><strong>ExchEngine.java</strong></p>

<pre><code>package engine;

public class ExchEngine {

    public ExchEngine() {
    }

    public static void main(String[] args) {

        ExchEngine engine = new ExchEngine();

    }
}
</code></pre>

<p>When I compile this file, I always get exception:</p>

<pre>
java.lang.NoClassDefFoundError: test_engine/ExchEngine
Caused by: java.lang.ClassNotFoundException: test_engine.ExchEngine
 at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
 at java.security.AccessController.doPrivileged(Native Method)
 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)
Exception in thread "main"
</pre>

<p>This seems very weird that ExchEngine.java is inside a package and it cannot run itself. Thanks for any help.</p>
