In the production environment, if the executable jar package is run only in Java-jar mode, multiple background service process names are ambiguous, and restarting can not be controlled automatically;
So use the Java service to deploy the jar package as a Windows service in the server.
Javaservice.exe-install aaaservice "%java_home%\jre\bin\server\jvm.dll"-djava.class.path= "G:\lrh\code\ Goodsmonitor\export\goodsmonitorscan.jar "-start goodsmonitormain-out" G:\lrh\code\goodsMonitor\export\out.log "- Err "G:\lrh\code\goodsMonitor\export\err.log"-current "G:\lrh\code\goodsMonitor\export"
Javaservice Download URL:javaservice. ow2.org Note Javaservice has 32-bit/64-bit distinction,
Javaservice.exe-install Service Name
"%java_home%\jre\bin\server\jvm.dll"
-djava.class.path= "Executable Java package path and dependent package path"
-start Main Method class path
-out "Output Path \out.log"
-err "Error Path \err.log"
-current "Execution Path"
Reference: http://blog.csdn.net/fox009/article/details/5708639
Javaservice Deploying a Jar package with Windows services