I looked at the site on all common posts, but my question is slightly different:
What is the best practice for packaging a simple Java application that has many other jar files as dependencies?
For example: I have foo.java with the main one in it and foo1.java, foo2.java, which are accessed from foo.java. And I use log4j.jar, mysql.jar in my eclipse build path.
Now I am using ant, which works well to create it. And what I am doing is writing a simple .sh script that references the entire classpath and log4j information. But that means I have to give them all these banks, and they should be in the right place. I want to be able to say "java -jar foo.jar" and run it on any computer without having to transfer any other files.
Maybe .jar is not the best way. I just want to provide someone with a single file that does not know how to configure the class path and all that, and be able to run it.
I am also curious about what is the best practice. Usually you just give someone a can and give them the mailbox of all the cans with the dependencies and tell them to put it in the class path?
Do you somehow do .rpm?
I am not familiar with MAVEN, but if this is the best way, I will do a tutorial. Now I am using ant.
source share