NoClassDefFoundError

If I executejava -jar jacobgen.jar it runs and I get:

JacobGen [options] typelibfile

Options:

-package:<destinationpackage name>

-destdir:<root dirfor classes>

-listfile:<listing file>

So I add the name of my 'typelibfile':java -jar jacobgen.jar xyz.dll and get:

JACOBGEN 0.4. Copyright 2000-2002 Massimiliano Bigatti. Relased under GNU GPL License

starting ...

Exception in thread"main" java.lang.NoClassDefFoundError: com/samskivert/viztool/clenum/ClassEnumerator

at com.jacob.jacobgen.Jacobgen.loadExternalClasses(Jacobgen.java:72)

at com.jacob.jacobgen.Jacobgen.generate(Jacobgen.java:121)

at com.jacob.jacobgen.Jacobgen.main(Jacobgen.java:397)

The problem I'm having is when I try to add viztool.jar to the command line (java -cp viztool.jar -jar jacobgen.jar xyz.dll) I still get that NoClassDefFoundError exception - I suspect I'm simply using the java command incorrectly (I've been looking at Java for just a few days)!

The three files (viztool.jar, jacobgen.jar, xyz.dll) are all in the folder I'm compiling from, and the xyz.dll and jacobgen.dll files are also in the windows\system32 folder (viztool is a pure java archive with no corresponding dll).

I'll be extremely grateful for any help!

[1475 byte] By [calzakka] at [2007-11-26 14:49:38]
# 1

Your call looks fine (java -cp viztool.jar -jar jacobgen.jar xyz.dll). but, as it's giving you a NoClassDefFoundError I can only suggest that the viztool.jar is the incorrect jar or wrong version.

You can check to see if that class (com/samskivert/viztool/clenum/ClassEnumerator) is in the jar using "jar -tf viztool.jar" to give you a list of whats in it.

Ted.

ted_trippina at 2007-7-8 8:37:39 > top of Java-index,Java Essentials,New To Java...
# 2

Thanks ted, but when I execute "jar -tf viztool.jar" I get the following, so that class if definitely there:

META-INF/

META-INF/MANIFEST.MF

com/

com/samskivert/

com/samskivert/viztool/

...

com/samskivert/viztool/clenum/

com/samskivert/viztool/clenum/ClassEnumerator$Warning.class

com/samskivert/viztool/clenum/ClassEnumerator.class

...

(I've cut out all irrelevant classes)

calzakka at 2007-7-8 8:37:39 > top of Java-index,Java Essentials,New To Java...
# 3
In that case I don't know. Hopefully someone else might. I noticed from the JACOBgen page that it has moved to sourceforge and is at version 1.8.Maybe you could get a later version and use the sourceforge forums to help you.Ted.
ted_trippina at 2007-7-8 8:37:39 > top of Java-index,Java Essentials,New To Java...