Backend Development 5 min read

Packaging a Spring Boot Application into an Executable Installer with exe4j and Inno Setup

This tutorial walks through converting a functional Spring Boot JAR into a Windows executable using exe4j, configuring the bundled JRE, and then creating a full installer with Inno Setup, enabling non‑technical users to install and run the application without a separate JDK.

Top Architect
Top Architect
Top Architect
Packaging a Spring Boot Application into an Executable Installer with exe4j and Inno Setup

The author, a senior architect, explains how to take a working Spring Boot JAR and turn it into a Windows executable (EXE) that can be installed by users unfamiliar with Java.

Preparation : Ensure you have a bug‑free JAR, install exe4j (a JAR‑to‑EXE converter), and Inno Setup (an installer creator).

Using exe4j : Open exe4j, select "Java to EXE", specify the JAR location, set the output path, and configure the launch mode. In the VM options add -Dfile.encoding=utf-8 . Enable the option to support both 32‑bit and 64‑bit systems, then continue through the wizard until the EXE (e.g., demo.exe ) is generated.

Bundling the JRE : In the JRE configuration step, choose "Client VM" and point to your local JRE directory. The goal is to package the JRE together with the EXE so the target machine does not need a separate JDK.

Creating the installer with Inno Setup : Open Inno Setup, start a new script, fill in basic application information, and add the generated EXE and the JRE folder. In the script include lines such as: "自己本地JRE路径*" DestDir: "{app}{#MyJreName}"; Flags: ignoreversion recursesubdirs createallsubdirs Proceed through the wizard, setting the output installer name (e.g., setup.exe ) and other options.

Final steps : Compile the Inno Setup script to produce setup.exe . Running this installer will place the bundled EXE and JRE on the target machine, creating shortcuts as needed. The resulting program can be distributed to users who can simply double‑click the installed shortcut to run the Spring Boot application.

JavaSpring BootpackagingInstallerexe4jInno Setup
Top Architect
Written by

Top Architect

Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.