meetgopi
asked on
java.lang.NoClassDefFoundError: com/anl/db/dbase
Hi,
I am getting Class not found exception. the details are i have jar file called anllib.jar located in c:\iftmin directory, i am using this jar file in a program called InterchangeStatus.java located in c:\iftmbf, when i try to run this program i am getting the following exceptions.
Exception in thread "main" java.lang.NoClassDefFoundE rror: com/anl/db/dbase
at java.lang.ClassLoader.defi neClass1(N ative Method)
at java.lang.ClassLoader.defi neClass(Un known Source)
at java.security.SecureClassL oader.defi neClass(Un known Source)
at java.net.URLClassLoader.de fineClass( Unknown Source)
at java.net.URLClassLoader.ac cess$100(U nknown Source)
at java.net.URLClassLoader$1. run(Unknow n Source)
at java.security.AccessContro ller.doPri vileged(Na tive Method)
at java.net.URLClassLoader.fi ndClass(Un known Source)
at java.lang.ClassLoader.load Class(Unkn own Source)
at sun.misc.Launcher$AppClass Loader.loa dClass(Unk nown Source)
at java.lang.ClassLoader.load Class(Unkn own Source)
at java.lang.ClassLoader.load ClassInter nal(Unknow n Source)
at InterchangeStatus.init(Int erchangeSt atus.java: 221)
at InterchangeStatus.main(Int erchangeSt atus.java: 542)
Thanks in advance
GOpi
I am getting Class not found exception. the details are i have jar file called anllib.jar located in c:\iftmin directory, i am using this jar file in a program called InterchangeStatus.java located in c:\iftmbf, when i try to run this program i am getting the following exceptions.
Exception in thread "main" java.lang.NoClassDefFoundE
at java.lang.ClassLoader.defi
at java.lang.ClassLoader.defi
at java.security.SecureClassL
at java.net.URLClassLoader.de
at java.net.URLClassLoader.ac
at java.net.URLClassLoader$1.
at java.security.AccessContro
at java.net.URLClassLoader.fi
at java.lang.ClassLoader.load
at sun.misc.Launcher$AppClass
at java.lang.ClassLoader.load
at java.lang.ClassLoader.load
at InterchangeStatus.init(Int
at InterchangeStatus.main(Int
Thanks in advance
GOpi
try running it using:
java -classpath c:\iftmbf;c:\iftmin\anllib .jar InterchangeStatus
java -classpath c:\iftmbf;c:\iftmin\anllib
IOW, do what i just said ...
ASKER
Thanks CEHJ, I checked everything it is ok. dbase is a java file located in anllib.jar under the directory structure com.anl.db and i have specified the class path to c:\iftmin\anllib.jar, previously i was getting error during compilation, it was solved. when i try to execute i am getting this error.
You need to specify the classpath at execution time too
> when i try to execute i am getting this error.
try the command I posted above, and tell me what errors you get
try the command I posted above, and tell me what errors you get
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Object, i have tried in all the possiblities of your suggestion.
java -classpath C:\IFTMBF;C:\iftmin\anl.ja r;C:\iftmi n\jtds-1.0 .2.jar;C:\ iftmin\twz 1.jar InterchangeStatus "%1" "%2"
i am getting the same error. i cannot copy that anllib.jar file to ext direc because this is common jar file for lot of applications.
java -classpath C:\IFTMBF;C:\iftmin\anl.ja
i am getting the same error. i cannot copy that anllib.jar file to ext direc because this is common jar file for lot of applications.
>>C:\iftmin\anl.jar
should be
C:\iftmin\anllib.jar
should be
C:\iftmin\anllib.jar
ASKER
sorry that's a typing mistake during the posting
> java -classpath C:\IFTMBF;C:\iftmin\anl.ja r;C:\iftmi n\jtds-1.0 .2.jar;C:\ iftmin\twz 1.jar InterchangeStatus "%1" "%2"
Thats not what I posted above :)
java -classpath c:\iftmbf;c:\iftmin\anllib .jar InterchangeStatus
If you need any other jars add them on
> i cannot copy that anllib.jar file to ext direc because this is common jar file for lot of applications.
Thats a good readon *for* copying it to the ext directory.,
That way it will be available to all apps
Thats not what I posted above :)
java -classpath c:\iftmbf;c:\iftmin\anllib
If you need any other jars add them on
> i cannot copy that anllib.jar file to ext direc because this is common jar file for lot of applications.
Thats a good readon *for* copying it to the ext directory.,
That way it will be available to all apps
>> sorry that's a typing mistake during the posting
Don't type - paste ;-)
Don't type - paste ;-)
c:\iftmin\anllib.jar
in the classpath and make sure you've got the imports right as
>>com/anl/db/dbase
looks like you might have defined that one wrong