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.NoClassDefFoundError: com/anl/db/dbase
        at java.lang.ClassLoader.defineClass1(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)
        at InterchangeStatus.init(InterchangeStatus.java:221)
        at InterchangeStatus.main(InterchangeStatus.java:542)

Thanks in advance
GOpi
meetgopiAsked:
Who is Participating?
 
objectsCommented:
Another way would be to copy the jar fiel to the ext directory of your jre(s)
0
 
CEHJCommented:
You need to have

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
0
 
objectsCommented:
try running it using:

java -classpath c:\iftmbf;c:\iftmin\anllib.jar  InterchangeStatus
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
CEHJCommented:
IOW, do what i just said ...
0
 
meetgopiAuthor Commented:
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.
0
 
CEHJCommented:
You need to specify the classpath at execution time too
0
 
objectsCommented:
>  when i try to execute i am getting this error.

try the command I posted above, and tell me what errors you get
0
 
meetgopiAuthor Commented:
Thanks Object, i have tried in all the possiblities of your suggestion.

java -classpath C:\IFTMBF;C:\iftmin\anl.jar;C:\iftmin\jtds-1.0.2.jar;C:\iftmin\twz1.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.
0
 
CEHJCommented:
>>C:\iftmin\anl.jar

should be

C:\iftmin\anllib.jar
0
 
meetgopiAuthor Commented:
sorry that's a typing mistake during the posting
0
 
objectsCommented:
> java -classpath C:\IFTMBF;C:\iftmin\anl.jar;C:\iftmin\jtds-1.0.2.jar;C:\iftmin\twz1.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
0
 
CEHJCommented:
>> sorry that's a typing mistake during the posting

Don't type - paste ;-)
0
 
CEHJCommented:
>> Accept: objects {http:#14015296}

Probably too late, but i don't agree
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.