On Fri, 12 Mar 1999, Steve Cohen wrote:
> I had previously thought the errors I was getting on execution were the
> result of using jikes. But apparently not so. Once javac finished its
> compilation, an identical exception occurred on executing the compiled
> application:
>
> [scohen@stevecoh jahtzee]$ java JahtzeeApp
> Exception in thread "main" java.lang.NoClassDefFoundError: JahtzeeApp (wrong
> name: jahtzee/JahtzeeApp)
> at java.lang.ClassLoader.defineClass0(Native Method)
> at java.lang.ClassLoader.defineClass(Compiled Code)
> at java.security.SecureClassLoader.defineClass(Compiled Code)
> at java.net.URLClassLoader.defineClass(Compiled Code)
> at java.net.URLClassLoader.access$1(Compiled Code)
> at java.net.URLClassLoader$1.run(Compiled Code)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Compiled Code)
> at java.lang.ClassLoader.loadClass(Compiled Code)
> at sun.misc.Launcher$AppClassLoader.loadClass(Compiled Code)
> at java.lang.ClassLoader.loadClass(Compiled Code)
>
> What is the problem here? This application worked when compiled under
> JDK117.
Is JahtzeeApp in a package? If so, try 'java jahtzee.JahtzeeApp'. If you
have a class in a package, then running it requires the fully qualified
name, ie. <packagename>.<classname>, and the .class file must be in a
directory called <packagename>, and _that_ directory needs to be in a
directory listed in the CLASSPATH.
. . . Sean.
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]