3 Replies Latest reply: Jan 11, 2007 6:57 AM by 807599 RSS

    NoClassDefFoundError

    807599
      If I execute java -jar jacobgen.jar it runs and I get:
      JacobGen [options] typelibfile
      
      Options:
              -package:<destination package name>
              -destdir:<root dir for 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!
        • 1. Re: NoClassDefFoundError
          807599
          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.
          • 2. Re: NoClassDefFoundError
            807599
            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)
            • 3. Re: NoClassDefFoundError
              807599
              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.