Java Question - Jar file which depends on another jar library?

Superwormy

Golden Member
Feb 7, 2001
1,637
0
0
I have a bunch of Java code, I can create an executable jar file with it. *BUT* that jar file needs to depend on three other jars:

smack.jar
smackx.jar
smackx-debug.jar


Right now when I run the jar file, it tells me:
Exception in thread "main" jara.lang.NoClassDefFoundError: /path/to/file/in/smack.jar
...


How do I get it to realize that those classes are in the other jars?
 

Wizkid

Platinum Member
Oct 11, 1999
2,728
0
0
Include the other JARs in your classpath... I believe you can do it system-wide (environment variable) or on the command line

java -cp smack.jar;smackx.jar;smackx-debug.jar ProgramToRun