{"id":16179251,"url":"https://github.com/jonashackt/springboot2exe","last_synced_at":"2025-03-19T01:30:55.944Z","repository":{"id":147270226,"uuid":"72181750","full_name":"jonashackt/springboot2exe","owner":"jonashackt","description":"How to package a SpringBoot App with JDKs standard javapackager","archived":false,"fork":false,"pushed_at":"2016-10-28T08:23:59.000Z","size":23,"stargazers_count":22,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-28T13:46:46.973Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonashackt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-28T06:53:53.000Z","updated_at":"2023-08-23T10:54:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"bd1f287d-fd01-4c80-99dc-7638e87e43c3","html_url":"https://github.com/jonashackt/springboot2exe","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonashackt%2Fspringboot2exe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonashackt%2Fspringboot2exe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonashackt%2Fspringboot2exe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonashackt%2Fspringboot2exe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonashackt","download_url":"https://codeload.github.com/jonashackt/springboot2exe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243958079,"owners_count":20374790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T05:26:23.033Z","updated_at":"2025-03-19T01:30:55.647Z","avatar_url":"https://github.com/jonashackt.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# springboot2exe - How to package a SpringBoot App with JDKs standard javapackager\n\nIf you ever happen to ask yourself how to package your [Spring Boot](https://projects.spring.io/spring-boot/) App as an .exe File for running in Windows (could that possibly happen :P ?!), then maybe the standard Oracle JDK [javapackager](http://docs.oracle.com/javase/8/docs/technotes/tools/windows/javapackager.html) could be something for you.\n\nThis is a simple example project to show how this is done\n\n#### 0. Build your Spring Boot App\n\nClearly, if you want to package a Spring Boot app, you need one first. Start on [spring initializr](http://start.spring.io/) or simply take this project :)\n\n\n#### 1. Be sure to run all that on a Windows Box!\n\nIt seems to be simple - but all those steps only run on a Windows Machine or VM and will fail on your Mac or Ubuntu :) So fire up one!\n\n#### 2. You just need a Standard Java-JDK-Installation\n\njavapackager will be included in your jdk_xxx\\bin Folder\n\n#### 3. Install current Inno Setup release\n\nAll the packaging is done through the freeware [Inno Setup](http://www.jrsoftware.org/isinfo.php) installer for Windows programs - javapackager builds upon it, when creating an exe-File. Get the latest version [here](http://www.jrsoftware.org/isdl.php) and __be sure to have administrative rights!__ Refrain from just installing it on some machine, packaging the resulting Folder under C:\\Program Files into a .zip and copy it to another Windows Box -\u003e __This will not work!__ You would get error messages, that are quite confusing like:\n\n```\nBundler EXE Installer skipped because of a configuration problem: Main application jar is missing. javapackager deploy exe\nAdvice to fix: Make sure to use fx:jar task to create main application jar javapackager\n```\n\n...which will point you in a complete false direction! This is one of the worst error messages I have ever seen :P I just got through to this, by stumbling upon this [blog post](http://code.makery.ch/library/javafx-8-tutorial/part7/)´s comments\n\n#### 4. do a normal Maven build\n\n```\nmvn clean package\n```\n\n#### 5. execute javapackager inside your target-Folder, where your Spring boot fat.jar was build\n\nWith our project, the command is something like this: \n\n```\njavapackager -deploy -native exe -outdir ./executable -srcfiles springboot2exe-0.0.1-SNAPSHOT.jar -outfile springboot2exe-0.0.1-SNAPSHOT -name springboot2exe-0.0.1-SNAPSHOT -title \"Spring Boot 2 .exe\" -appclass org.springframework.boot.loader.JarLauncher -v\n```\n\nThe -appclass __is not your Application.class__ with the main in it! You need to pick Spring Boot´s __org.springframework.boot.loader.JarLauncher__\n\n\n#### 6. Install target/executable/springboot2exe-0.0.1-SNAPSHOT.exe\n\nYou´ll find a __springboot2exe-0.0.1-SNAPSHOT.exe__ inside your __target/executable/bundles__ folder - install it and it will create a folder inside of __C:\\Users\\YourUserHere\\AppData\\Local\\JarLauncher__, where the __runtime folder__ holds a JRE and the __app folder__ contains your fat.jar.\n\n#### 7. Start springboot2exe-0.0.1-SNAPSHOT\n\nStart __C:\\Users\\YourUserHere\\AppData\\Local\\JarLauncher\\springboot2exe-0.0.1-SNAPSHOT.exe__ - it´s named the same like the installer, but it´s the actual runnable .exe File you wanted. Just take a look inside your Windows Taskmanager:\n\n![taskmanager_process_jarlauncher](https://github.com/jonashackt/springboot2exe/blob/master/taskmanager_process_jarlauncher.png)\n\n\n## More things to do\n\n#### You need a MacOS DMG?\n\njavapackager is also capable of packaging DMG Files - read [this post](https://www.igorkromin.net/index.php/2015/07/27/how-to-package-your-java-code-as-a-native-app-on-osx-into-a-dmg-file/) or google it :)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonashackt%2Fspringboot2exe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonashackt%2Fspringboot2exe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonashackt%2Fspringboot2exe/lists"}