M
Mark Probert
Hi, all.
I am new to Java, though experienced in other languages, and I am not
really getting the CLASSPATH thing. Here is my exact problem:
I am trying to use an SNMP library (from Westhawk). The library tests
run fine and the example code works okay (executed via Ant). Now, I take
the library jar and try and make it work from the command-line. Javac is
not a problem and I get my class files, then create an app jar (called
disp1.jar). My problem comes when I try and run it:
(mark@locke) 11:42 $ java -cp snmp5_1.jar -jar disp1.jar
Exception in thread "main" java.lang.NoClassDefFoundError:
uk/co/westhawk/snmp/stack/AsnOctetsPrintableFace
at java.lang.ClassLoader.defineClass0(Native Method)
<etc.>
Now, that missing class is in the snmp5_1.jar. I can unjar it and see it
in there.
So, what gives? Obviously I am not understanding something here.
Regards,
I am new to Java, though experienced in other languages, and I am not
really getting the CLASSPATH thing. Here is my exact problem:
I am trying to use an SNMP library (from Westhawk). The library tests
run fine and the example code works okay (executed via Ant). Now, I take
the library jar and try and make it work from the command-line. Javac is
not a problem and I get my class files, then create an app jar (called
disp1.jar). My problem comes when I try and run it:
(mark@locke) 11:42 $ java -cp snmp5_1.jar -jar disp1.jar
Exception in thread "main" java.lang.NoClassDefFoundError:
uk/co/westhawk/snmp/stack/AsnOctetsPrintableFace
at java.lang.ClassLoader.defineClass0(Native Method)
<etc.>
Now, that missing class is in the snmp5_1.jar. I can unjar it and see it
in there.
So, what gives? Obviously I am not understanding something here.
Regards,