0

I have a Spring Boot Web Application containing Rest services with build tool Maven. On using the install/package command, it generates .jar file under /target folder.

I have tried a couple of tools like Launch4J,JSmooth etc. the generated EXE doesn't work. I am trying to convert my Spring Boot Web Application to an .EXE for Windows. I am looking for a solution where I can configure EXE generation in POM file.

Thanks.

Prakash
  • 47
  • 3
  • Does the jar file you have, work as it is? – Thorbjørn Ravn Andersen Oct 11 '22 at 05:08
  • Why you want to but? `JAR` itself is an `executable` , just with a minor catch that it requires a JVM which comes separate depending on platform i.e. Windows, Unix, Mac etc ! You should be able to execute your JAR with Java command line or any IDE , or even as a UI application is it is Java Swings (UI Based) – Harsh Oct 11 '22 at 05:42
  • @Harsh, Our Client is using a Windows machine and we want to give an Exe to the client to simplify the running of the program. We can allow launching the application via jar command But the User may accidentally close the running instance. Just for convenience we are planning to share EXE. – Prakash Oct 11 '22 at 13:07
  • @ThorbjørnRavnAndersen, Yes, We are able to run the application via jar and it's working fine. We don't expect the Client to run the jar command properly, that is why we are planning to share EXE for the spring boot web application. – Prakash Oct 11 '22 at 13:14
  • A simple solution, just create a `.bat` file with Java command inside, you can create in notepad and mention the java command to execute , simply store with .bat extension, bat is executable in windows, it will execute the command within ! – Harsh Oct 11 '22 at 13:15
  • Meanwhile , does this article help ? https://stackoverflow.com/questions/73909841/spring-boot-application-exe-file?rq=1 – Harsh Oct 11 '22 at 13:17
  • @Harsh, Thanks for your help. Yes, have created a run.bat file already which contains the command to execute the jar. It is working fine. I have followed the article as well and the EXE is created. But when I am running EXE, it is not really loading my application. I am looking for something which I can configure in POM file to generate EXE file on using install/package maven command. – Prakash Oct 11 '22 at 16:05

0 Answers0