build it. brand it. share it.
Turn a runnable Java application into a Windows executable that people can double-click.
Snug wraps your Java application JAR (or a directory of JARs) in a native Windows x64 .exe. It helps launch Java, can offer to download a compatible runtime, and lets you add your own icon, splash screen, and application details. It's designed for people who want to share a working Java application without asking others to run a JAR manually.
Development status: Snug is under active development and a beta version has been released. Check Releases for available builds.
See the completed documentation of what snug can do at https://synapticloop.github.io/snug/
You need the Windows snug.exe builder and a runnable Java JAR. To try Snug without writing Java code, use the included JavaFX demo JAR.
-
Download the Windows x64 ZIP from GitHub Releases and extract it to a folder.
-
Put
snug.exeandsnug-javafx-demo-windows.jarin a folder. -
Open a terminal in that folder and run:
.\snug.exe .\snug-javafx-demo-windows.jar
-
Double-click the resulting
snug-javafx-demo-windows.exe.
The executable contains your Java application and the native launcher. On first launch, Snug can offer to download a compatible Java runtime if one is not already available.
In a hurry? Each release also ships
snug-javafx-demo-windows.exebeside the demo JAR — the same demo, already built by snug. Download it from GitHub Releases and double-click it; there is no build step to run.
Already have your own runnable JAR? Use the same approach:
.\snug.exe .\MyApplication.jarBy default, Snug creates MyApplication.exe alongside the input JAR. Existing snug.options files can supply additional settings.
- Double-click to run. Share a familiar Windows executable instead of instructions for running a JAR.
- Java runtime assistance. Snug looks for a compatible Java installation and can offer to download Eclipse Temurin when needed.
- Your application, your branding. Add an icon, splash screen, name, version, and Windows application details.
- Straightforward sharing. Keep small business and personal tools local, and choose how to distribute the executable.
Start with the minimum command above, then add options as needed:
.\snug.exe .\MyApplication.jar --name "My Application" --company "My Company" --icon .\icon.png --version 1.0.0--name and --company are optional. Snug derives defaults from the input name.
For repeated builds, Snug supports snug.options configuration files. Run snug.exe --init-options for a starter file or snug.exe --help to see the full command-line reference. You can also customise runtime messages and supply translations using localisation files.
Snug is an application builder, not an installer. The resulting .exe is the application you share. Snug does not create Start menu entries, install your application into Program Files, or provide an uninstaller. Delete that executable and the application is no longer available from it, although cached files and downloaded Java runtimes may remain.
Snug does not automatically update your application, sign the executable, or publish it to an application store. You decide how to distribute new versions. Unsigned executables may trigger Windows security warnings or be subject to organisational policies.
A Snug-built executable embeds your JAR or JARs and application configuration. When launched, it extracts the application into a per-user cache, finds a suitable Java runtime, and invokes Java through JNI. The application runs under its own .exe process name, rather than javaw.exe.
By default Snug requires Java 25 or newer; you can configure the minimum Java version with --min-java. If a compatible runtime is missing, Snug can offer to download Eclipse Temurin, verifying the downloaded archive with SHA-256.
Every build writes a log recording the options the build actually used and where each one came from, every diagnostic raised along the way, and where the output was written. By default the log is snug.build.log in the directory you ran snug from, and each build replaces the one before it. Use --build-log <PATH> to write it elsewhere.
The effective-options table is the part worth reading:
Effective build options:
input: MyApplication.jar [command line]
output: MyApplication.exe [inferred from input]
min-java: 25 [default]
name: My Application [snug.options:74]
The origin tells you whether a value came from the command line, an options file, a JAR manifest, or a built-in default — so a surprising setting is traceable to its source rather than guessed at.
Diagnostics carry stable codes such as SNUG-JAVA-001. The code is what you quote in a bug report, and it does not change when the wording does. An error stops the build; a warning does not. The full code reference explains what each one means — and, just as usefully, what each check does not cover.
A few flags worth knowing alongside it:
--dry-run— validate the inputs and show what would be built, without writing an executable.--find-main— list the classes in your JARs that declare amainmethod.--list-tokens— list the launcher message keys and the placeholders each one accepts, for translation.
Run snug.exe --help for the authoritative reference to every option.
- Releases - available builds.
- Command-line options - source definitions;
snug.exe --helpis the authoritative reference for your build. - Build diagnostics - what each diagnostic code means, and how to read the build log.
- Localisation token reference - placeholders available in translated launcher messages.
- Repository development notes - implementation details and contributor context.
- Build validation design - how the diagnostics and build log were designed, for contributors.
- Say Hello to Snug - the companion guide to building, branding, and sharing your first executable.
Snug is written in Rust. For Windows builds, use the repository's scripts/windows/build.cmd script, which builds the launcher and builder in the required order. See development notes for details.
The initial supported release targets Windows x64. Experimental code for other platforms may exist in the repository but is not part of this release.
Dual-licensed under MIT or Apache-2.0, at your option.
