How to Convert a Spring Boot JAR into a Standalone EXE Installer for Non‑Tech Users
This step‑by‑step guide shows how to package a functional Spring Boot JAR into a Windows executable using exe4j, embed a local JRE, and create an all‑in‑one installer with Inno Setup so even users without Java knowledge can install and run the application.
Preparation
Before starting, you need:
A bug‑free JAR that can start normally.
exe4j – a tool to convert JAR to EXE (download link and registration code provided).
Inno Setup – a tool to bundle the EXE and its dependencies into a single installer (download link and extraction code provided).
Start
Place the JAR on the desktop.
Open exe4j and select "Java to EXE".
Enter the output name and path, then choose the launch mode.
Enable the option to make the packaged program compatible with both 32‑bit and 64‑bit systems.
In the VM parameters field, add -Dfile.encoding=utf-8.
Configure the JRE so that the generated EXE bundles a local JRE directory, allowing the program to run on machines without a pre‑installed JDK.
Select "Client VM" and continue until the final configuration screen appears.
At this point, a demo.exe file appears on the desktop. Do not run it yet; the next step is to bundle the EXE with the JRE using Inno Setup.
Open Inno Setup (File → New) and proceed through the wizard, providing an application name and version.
When prompted, select the previously generated demo.exe file.
Continue with default settings until you reach the script editor. Add a line to copy the local JRE into the installation directory, for example:
Source: "YourLocalJREPath\*"; DestDir: "{app}\{#MyJreName}"; Flags: ignoreversion recursesubdirs createallsubdirsSave the script, then compile the installer. After the compilation finishes, a setup.exe appears on the desktop.
Run the generated installer; it will install the application and optionally create a shortcut. The final program can now be distributed as setup.exe , allowing users without Java installed to run the Spring Boot application seamlessly.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Programmer DD
A tinkering programmer and author of "Spring Cloud Microservices in Action"
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
