i wrote an application with java , and i use JGoodies in my code . when i export jar file , that file doesn't run in another systems . how can i bundle my program with JGoodies jar files ?
Asked
Active
Viewed 211 times
0
-
Put both jar files in a zip file? Or create a jar file with the content of your jar and the content of the jgoodies jar? – JB Nizet May 14 '12 at 09:03
-
i found same problem , i think i should use maven ... but i don't know how ... – Omid Yaghoubi May 14 '12 at 10:17
-
Please describe your problem better. What do you have difficulties with? bundling your program? starting it? Any error message? How do you start it? – JB Nizet May 14 '12 at 10:21
1 Answers
0
There are essentially two ways to do this, but it all boils down to making sure that your classes and the JGoodies classes are both in the classpath when the user runs the application.
The first way is to simply distribute your jar file along with the JGoodies jar file, and any jar files that either of them depend upon. The user then must include all (both) of those jars in their classpath with, the '-cp' option to the java command line.
The second option is to re-bundle all of the classes into one big jar file (usually referred to as an 'uber-jar'). If your build uses Maven, or you can convert to Maven, you can use the Maven Assembly Plugin - http://maven.apache.org/plugins/maven-assembly-plugin/

GreyBeardedGeek
- 29,460
- 2
- 47
- 67