How to Package a Spring Boot Application into an EXE Installer Using exe4j and Inno Setup
This tutorial walks through preparing a Spring Boot JAR, converting it to an executable with exe4j, embedding a local JRE, and finally creating a user‑friendly installer using Inno Setup, enabling distribution to computers without a pre‑installed JDK.
The author needed to turn a Spring Boot JAR into a standalone executable for non‑technical users and documents the entire process.
Preparation: Obtain a working JAR, download exe4j (link: https://pan.baidu.com/s/1hpfhYNWXbojq1F82Pp7KTQ, extraction code: 6hzf, registration code: L-g782dn2d-1f1yqxx1rv1sqd) and Inno Setup (link: https://pan.baidu.com/s/1AjuG2jbIVroLcNR4y8Rtug, extraction code: nnzd).
Using exe4j: Open exe4j, select “Java to EXE”, set the application name and output path, choose the launch mode, enable 32‑ and 64‑bit compatibility, add the VM parameter -Dfile.encoding=utf-8, configure the embedded JRE (point to a local JRE folder), select Client VM, and complete the wizard to generate demo.exe.
Using Inno Setup: Create a new script (File → New), fill in basic application information, add the generated demo.exe, specify the output directory, and embed the local JRE files with the line
Source: "自己本地JRE路径\*"; DestDir: "{app}\{#MyJreName}"; Flags: ignoreversion recursesubdirs createallsubdirs. Compile the script to produce setup.exe.
Result: The resulting setup.exe installs the application together with the bundled JRE, allowing it to run on machines without a JDK; the installer can be shared with other users.
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.
Code Ape Tech Column
Former Ant Group P8 engineer, pure technologist, sharing full‑stack Java, job interview and career advice through a column. Site: java-family.cn
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.
