Exception in thread

hello...

in this case my situation is quite different from the others who have faced the same problem and asked for help in this forum....

i have all my java files in the D:\SNMP folder

in this folder i created a subfolder (lib) to store the SNMP4J.jar file...

so i can use it for my project...

i compiled this file by the following command...

javac -classpath ./classes/;./lib/SNMP4J.jar Testsnmp.java

it compiled succesfully....

now i run this program by....

java -classpath ./classes/;./lib/SNMP4J.jar Testsnmp

now it generates the NOClassDefFound error...

So i thought there must be some problem in my JDK...

so i devoloped a simple hello world program..in the same folder..

and it runs succesfully

[javac Hello.java

java Hello]

Now i used Winrar to extract the jar file.(which i certeinly dont like to do)

and placed the org folder in the SNMP folder...and compile with javac and it runs succesfully by "java Testsnmp" command...

Now the problem is i am using another java package which also have org folder...so i cant have 2 org folder in my project folder(SNMP)....

now how can i run the program without unpacking the jar file...

help me out of it....

sam

[1296 byte] By [samriddha] at [2007-11-26 21:09:34]
# 1

> java -classpath ./classes/;./lib/SNMP4J.jar Testsnmp

> now it generates the NOClassDefFound error...

When your class Testsnmp is in the default package and your working dir is where the Testsnmp.class lives this should be nearly ok

Try to include the working dir in the classpath, so:

java -classpath ./classes/;./lib/SNMP4J.jar;. Testsnmp

just my 2 cents...

Gazbooa at 2007-7-10 2:45:41 > top of Java-index,Java Essentials,New To Java...