Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java program as windows service

Tags:

java

windows

I have a java program which need to be run as a service. How do I do that easily?

like image 613
fastcodejava Avatar asked Aug 12 '10 04:08

fastcodejava


People also ask

How do I run a Java program as a service?

We can do this by passing the daemon-reload command to systemctl. We'll need to run the daemon-reload command each time we modify the unit file. Next, we notice the system reports our service running but disabled. Disabled services will not start automatically when the system boots.


2 Answers

Good explanations in this article -- including the pointer to the Java Service Wrapper open-source component that makes it easy.

like image 162
Alex Martelli Avatar answered Oct 05 '22 13:10

Alex Martelli


Write a service in C/C++ and load the JVM from that. Or you can use some tool that wraps your Java application to a service.

like image 36
Vijay Mathew Avatar answered Oct 05 '22 13:10

Vijay Mathew