I am looking to write more stand-alone Java applications. Most of my prior work has been in a servlet container environment that has protected me somewhat from the vagueness of the underlying OS, the classpath, etc.
For example, one problem that I am seeing is that creating a jar file with an executable Main-Class defined but which also depends on other jars does not seem to work unless those other jars are in the same directory as the jar being executed.
What I am looking for is not specifically an answer to this but suggestions on web sites, books, and other material that would assist me in making the jump from writing web appplications (.wars) to stand-alone .jars. Things like how classpath is managed when running "java -jar myapp.jar" don't seem to be well documented and I'm not finding many resouces to explain what I am seeing.
You might want to look into the Java glossary at http://www.mindprod.com/jgloss.html - this has proven to be an invaluable resource for me for info for stand-alone Java applications.
Thanks for the reference. That was the first place that I found that explicitly stated that running java -jar someapp.jar ignores the defined classpath.
What I am wondering then is how apps that I've seen written in Java, and which come with numerous additional jar files external to the main app jar file manage to load and access those classes.
I'm sure I can muddle my way through this monkeying perhaps with the ClassLoader or the java.class.path system property (or both) but I was really hoping to find a useful discussion of this issue along with suggestions from others who had to trailblaze this way already.
Apparently the crimson.jar allows you to dynamically load jars in a Directory (see how JBoss works). ANT also allows you to dynamically create a classpath.