Help with executing a jar file

B

Bryan

Hello all,

I'm having trouble executing a jar file I created using Eclipse. I
have two projects set up in Eclipse... one with all the main source
code (no Main classes) and another with a main class that utilizes code
from the other project. I created a jar of the first project and added
the jar to the build path of the second project and I can run the Main
class in the second project no problem. I then created a jar file of
the second project and included the Main class in the manifest. When I
try to execute this jar file from the command line I get the following
error:

% java -cp SourceCode.jar -jar Executable.jar
Exception in thread "main" java.lang.NoClassDefFoundError:
/path/to/some/package/class

Both the source jar and the executable jar are in the current working
directory. Any clues as to why this isn't working?

Thanks!
 
B

Bryan

So how do I tell it to include SourceCode.jar in the classpath so
Executable.jar has access to it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,740
Latest member
AdolphBig6

Latest Threads

Top