I just packed all my classes in a nice jar and designated the class with main using Main-Class. Now the problem starts:
java -jar -classpath %A_BUNCH_OF_CLASSPATH% app.jar
Guess what, java cannot find the classes on the -classpath? Does java look at the -classpath at all when executing an application within a .jar file?
Thanks for all your help!
Are you sure that the directory that the jar file is in (possibly the current directory) is in the classpath?
java -jar -classpath %A_BUNCH_OF_CLASSPATH%;. app.jar
(nb ------ )
It executes my app in the app.jar, but my app cannot find the JDBC driver which is specified in the -classpath argument.
Yeah, I do have the "." in the -classpath.
If I run my app using the same classpath settings but with the classes in a directory structure instead of packaged in a .jar file, everything works great.
If one wants to run from a .jar file, does all extra class libraries need to be in the .jar file as well?
Yoy seem to have a space in your -classpath parm