Search code examples
javaangularspring-bootwindows-server-2012

run a executable jar in windows server


I am using windows server to run my application. Application is built on spring boot & angular 2. I want to run the executable jar in the windows server.

I have the following queries.

  1. Which is the best practice to run the jar rather than running java -jar abc.jar in cmd.
  2. Best practice to log the application logs in the above configuration.

Solution

  • I recommend running it as a windows service

    nssm install <servicename> "C:\Program Files\Java\jre7\java.exe" "-jar <path-to-jar-file>"