Packaging a Java app. w/DB to run on client machine

1.2k Views Asked by At

I made a simple java desktop application using embedded database. I wanted to package all files into a single file like exe so that client can click just on one file and use the application. I made the jar file and its working fine on my system when double clicking. I wanted to package the DB file along with jar because the data is shown only when the DB file is in the same folder of jar file.

I came across several tools like launch4j, install4j etc. but I didn't find where to include the DB file along with the package.

2

There are 2 best solutions below

1
Matthew Farwell On

It sounds like you want an installer of some description, such as IzPack. This would allow you to package both jar and database together, and install them on a client system.

1
Andrew Thompson On

A good way to deploy rich client (e.g. Swing/AWT) apps. that require some set-up (as in, installing a DB) is by using Java Web Start.

JWS offers the ExtensionInstallerService which..

..is used by an extension installer to communicate with the JNLP Client. It provides the following type of functionality:

  • Access to prefered installation location, and other information about the JNLP Client
  • Manipulation of the JNLP Client's download screen
  • Methods for updating the JNLP Client with the installed code

Here is a demo. of the EIS (with code, build file etc.).