Whats best way to package a Java Application with lots of dependencies?

后端 未结 7 1928
醉酒成梦
醉酒成梦 2021-01-11 14:22

I\'m writing a java app using eclipse which references a few external jars and requires some config files to be user accessable.

  1. What is the best way to pac

7条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-11 14:37

    Well, if you are speaking of deployment of a standalone desktop application:

    Before we switched to web start we have been creating three deployment archives, one for windows, one for mac and one for other platforms.

    On windows we have successfully used the Nullsoft Scriptable Install System (known for it's usage by the older winamp versions) and its ant task, although some drawbacks are:

    • It is only usable on windows AFAIR
    • You have to do some work by hand, i.e. customizing the wizard-created script AFAIR

    It can create a windows installation with start menu entries on the other hand. There also exists an eclipse plugin for integrated NSIS shell script editing.

    On Mac OS X there is an ant task to create an .app file from your java files so that you can start it like a native os x application. But beware of not writing any setting to your home dir and using the the application dir instead.

    For others you have to expect they are in a un*x env and deploy your app with a shell script to start the application.

    In any case you may have to deploy your custom policy file to get access rights for your application.

    If you want to get rid of all the packaging and stuff you should seriously consider using web start. We have saved much time since switching to it, i.e. simplified our deployment process, takes care of updates etc.

    Update 2014

    Use maven assembly plugin, see section "Creating an executable jar"

提交回复
热议问题