Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NoClassDefFoundError

1 view
Skip to first unread message

Anton An

unread,
Oct 10, 2000, 3:00:00 AM10/10/00
to
Hi all,

I was trying to run an application by runing the following batch file.

set CLASSPATH=%CLASSPATH%;f:\anton\protege\class\edu\stanford\smi\protege;.
cd f:\anton\protege\class\edu\stanford\smi\protege
java -classpath %CLASSPATH% Application

I got an NoClassDefFoundError
Exception in thread "main" java.lang.NoClassDefFoundError: Application
(wrong name: edu/stanford/smi/protege/Application)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

The Application.class is the main program. There are also some subpackages
under edu/stanford/smi/protege.

I also wrote a simple Test class and put it in the same directory, and it
compiled and ran all right. I have no clue why Application can not be run.
Does anyone know the reasons? Thanks a lot in advance.

Anton


Luc Kumps

unread,
Oct 10, 2000, 3:00:00 AM10/10/00
to
> I was trying to run an application by runing the following batch file.
>
> set
CLASSPATH=%CLASSPATH%;f:\anton\protege\class\edu\stanford\smi\protege;.
> cd f:\anton\protege\class\edu\stanford\smi\protege
> java -classpath %CLASSPATH% Application
>
> I got an NoClassDefFoundError
> Exception in thread "main" java.lang.NoClassDefFoundError: Application
> (wrong name: edu/stanford/smi/protege/Application)

I think you should try

cd f:\anton\protege\class

java -classpath %CLASSPATH% edu.stanford.smi.protege.Application

Luc


Roedy Green

unread,
Oct 11, 2000, 2:37:26 AM10/11/00
to
For this or any other mysterious compiler or run time message see
http://mindprod.com/errormessages.html


The Java & Internet Glossary is at http://mindprod.com
--
Roedy Green, Canadian Mind Products
-30-

0 new messages