Backend Development 5 min read

How to Package a Spring Boot Application into an Executable (EXE) Using exe4j and Inno Setup

This guide walks through converting a Spring Boot JAR into a Windows executable using exe4j, configuring the EXE for 32/64‑bit compatibility, adding VM parameters, and then packaging the EXE together with a local JRE into an installer with Inno Setup, providing step‑by‑step screenshots and script details.

Top Architect
Top Architect
Top Architect
How to Package a Spring Boot Application into an Executable (EXE) Using exe4j and Inno Setup

The article describes a step‑by‑step process for turning a functional Spring Boot JAR file into a standalone Windows executable and installer, aimed at users who need a simple double‑click installation experience.

Preparation : Ensure you have a bug‑free JAR, download exe4j (extraction code: 6esr, registration code provided) and Inno Setup (extraction code: g9jd).

Creating the EXE with exe4j : Open exe4j, select the "Java to EXE" wizard, set the project name and output path, choose the launch mode, and enable the option to support both 32‑bit and 64‑bit systems. In the VM parameters field add -Dfile.encoding=utf-8 . Configure the JRE settings to bundle a local JRE with the executable.

Packaging with Inno Setup : Launch Inno Setup, create a new script, and fill in basic information such as application name and version. Add the generated EXE and the bundled JRE directory to the script. Example script line for including the JRE: Source: "自己本地JRE路径\*"; DestDir: "{app}\{#MyJreName}"; Flags: ignoreversion recursesubdirs createallsubdirs

Proceed through the wizard, selecting language, output folder, and installer name. Accept default settings for most pages, then compile the script. After compilation a setup.exe file appears on the desktop.

Running setup.exe installs the application and creates a shortcut. The resulting program can be distributed to users who do not have a JDK or Java runtime installed.

Spring BootInstallationExecutableexe4jInno SetupJava packaging
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.