I looked through the site at all the common posts but my question differs slightly:
What is the best practice for packing a simple Java application that has many other jar files as dependencies?
For example: I have foo.java with a main in it, and foo1.java, foo2.java that are accessed from foo.java. And I am using log4j.jar, mysql.jar on my eclipse build path.
Right now I am using ant, which works well to build it. And what I do is write a simple .sh script that references all the classpath and log4j info. But this means I have to give them all those jars and they have to be in the right location. I want to be able to say "java -jar foo.jar" and have it run on any machine without having to transfer any other files.
Maybe a .jar is not the best way to go. I just want to be able to give one file to someone, who does not know how to setup a class path and everything, and have it able to run.
Also I am curious as to what the best practice is. Do you usually just give someone a jar and give them a zip of all the dependency jars and tell them to put it on the class path?
Do you somehow make a .rpm?
I am not familiar with MAVEN, but if that is the best way, I will do a tutorial. Right now I use ant.