1

I have spring boot executable jar file which can run into any command prompt by calling java -jar filename.jar.

I want to create a service with out downloading any external libraries for the above code snippet.

Help me if there is a strait forward way.

1 Answers1

0

I want to create a service with out downloading any external libraries

No.

A Windows service is, by definition, its own binary.

There exists the svchost.exe binary, which stands for "Service Host," which can host several shared Microsoft services, but you cannot share with your 3rd party service. It's not supported. The main reason is that a crash or defect in one service can affect all the services in a shared svchost.exe instance. And no one wants to risk sharing your weird Java thing with fundamental OS services in a shared svchost.

[Reference]

In the old Win2000 days, there was an "srvany.exe" binary, but that is so old and decrepit, no one should be using it in 2017.

A simple Google search tells me that there exists such a thing as "Java Service Wrapper" or another thing called "Non-Sucking Service Wrapper"... but these are both separate 3rd party binaries that are not part of Windows and are definitely not supported by Microsoft therefore the answer to your question is still 'No.'

The bottom line is that you need your own, not-supplied-by-Microsoft hosting process to host your weird service.

Ryan Ries
  • 55,011
  • 9
  • 138
  • 197