How to Combine Multiple Jars into One?

前端 未结 2 1950
旧时难觅i
旧时难觅i 2020-12-18 23:43

I\'ve read so many articles/explanations on this and spent too many hours, but everything is either too broad or specific.

This question really only applies to an Ap

相关标签:
2条回答
  • 2020-12-18 23:55

    From the base of your bin directory, why not try:

    jar.exe -cvf cxapplet.jar *
    

    Place your external jar files in the appropriate location in you your bin directory, and manually jar your class files with the external jar files.

    Alternatively, see this thread which might provide more information for you.

    0 讨论(0)
  • 2020-12-19 00:14

    First of all, let me say that there really is no reason to combine the jars - you can deploy an applet using your class file (not in a jar) and its separate dependent jars.

    However, if you feel that you must make one big jar out of your class and all of its dependencies, then you can do so.

    You can't put jar files into another jar file, however - jar files don't work that way. What you need is for all of the contents of all of the jar files to be extracted, and then zipped up again into one jar.

    If you're going to do this, I would suggest using the Maven build tool to do it. Once you set up your build with Maven, you can configure the Maven Assembly Plugin to build one big jar for you.

    I know that Eclipse supports Maven, and I assume that NetBeans does as well.

    0 讨论(0)
提交回复
热议问题