This installer will first check if jvm is present on the system or not. If not then it will first install the jvm. After that it will include the java code (may be in jar) alongwith the database used. And finally it will create a desktop shortcut and make changes to registry as other s/w does.

- 168,117
- 40
- 217
- 433

- 29
- 6
-
1(Possibly) Duplicate of: http://stackoverflow.com/questions/184060/java-application-installers – m4tx Aug 30 '12 at 11:53
-
Use `deployJava.js` to check for the appropriate JRE versions, then (install the DB and add a desktop shortcut and/or menu item and) launch it with [Java Web Start](http://stackoverflow.com/tags/java-web-start/info) (supplied by Oracle, works on Windows, Mac & *nix). – Andrew Thompson Aug 30 '12 at 12:33
2 Answers
First you need to decide on a setup authoring tool. Here is a list which can get you started: http://en.wikipedia.org/wiki/List_of_installation_software
Advanced Installer is one of the tools which has a dedicated Java project type.
To detect and install JVM, you can add it as a prerequisite. This is done differently for each setup tool.

- 21,216
- 5
- 45
- 60
There is a new tool being developed for that: jpackage
If your project is build using Gradle then you can easily use the Badass jlink plugin: https://github.com/beryx/badass-jlink-plugin to build an installer / package using jpackage
Here's an article how to build an app image using OpenJDK 11 and using OpenJDK 14 with jpackage only for building the installer / package: https://walczak.it/blog/distributing-javafx-desktop-applications-without-requiring-jvm-using-jlink-and-jpackage

- 1,339
- 12
- 11