How to Turn a Spring Boot JAR into a Standalone EXE Installer for Non‑Tech Users

Learn step‑by‑step how to convert a functional Spring Boot JAR into a Windows executable using exe4j, embed the required JRE, and package everything into an installer with Inno Setup, enabling users without Java installed to run your application effortlessly.

Java Backend Technology
Java Backend Technology
Java Backend Technology
How to Turn a Spring Boot JAR into a Standalone EXE Installer for Non‑Tech Users

Preface

Recently I built a combined Spring Boot front‑and‑back end project and needed to deliver it as an executable file for non‑technical users. After many pitfalls I documented the steps so readers can avoid the same issues.

Preparation

Prerequisites

A functional JAR file that starts without bugs.

exe4j – a tool to convert JAR to EXE.

Inno Setup – a tool to bundle the EXE and its dependencies into an installer.

Start

Place the JAR on the desktop (example).

Open exe4j.

Proceed through the wizard, selecting “Java to EXE”.

Enter the output name and path.

Select the launch mode and ensure the generated program supports both 32‑bit and 64‑bit systems.

In the VM parameters field add:

-Dfile.encoding=utf-8

Configure the bundled JRE.

Set the JRE path and other options.

Select “Client VM”.

Finish the wizard; the generated EXE (e.g., demo.exe ) appears on the desktop.

Open Inno Setup and create a new script.

Fill in application name, version, etc.

Proceed with default options until the “Application files” page, then select the previously generated EXE.

Keep default settings for the next pages.

Select the installer language.

Specify the output folder and installer name.

When the script reaches the “Compile” step, choose “No” to edit the script manually.

Insert the JRE path into the script:

Source: "自己本地JRE路径*";
DestDir: "{app}{#MyJreName}"; Flags: ignoreversion recursesubdirs createallsubdirs

Compile the script; a green progress bar indicates the build.

When finished, a setup.exe appears on the desktop.

Running the installer creates a shortcut and installs the application, which can now be launched without any Java runtime installed on the target machine.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

JavaSpring BootExe4JInno SetupWindows InstallerJAR to EXE
Java Backend Technology
Written by

Java Backend Technology

Focus on Java-related technologies: SSM, Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading. Occasionally cover DevOps tools like Jenkins, Nexus, Docker, and ELK. Also share technical insights from time to time, committed to Java full-stack development!

0 followers
Reader feedback

How this landed with the community

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.