1

I know you can run a jar as a windows service by calling it from a batch file or something similar to that, and I know that when you use an application server such as WAS, or Glassfish you have JVMS's that are "running" per-se. But unless I am mistaken, those aren't necessarily "services". That is to say processes that are executing without input from any user. From my understanding you still need to call a JVM to get it to execute a process (and please feel free to correct me if I am wrong). But I have always been curious as to what is the Java/Linux equivalent of the Windows Service? Maybe it is JVM's running in an application server like Tomcat, or Glassfish.

SoftwareSavant
  • 8,456
  • 26
  • 107
  • 186
  • There's cron on the *nix systems... but I doubt there's any Java process that can run w/o JVM's. There's also Spring Batch – user1766760 Mar 13 '14 at 16:10

2 Answers2

1

It depends on the exact flavor of Linux being used, but the conceptual siblings to a Windows Service (i.e. a long-running daemon that the OS starts when the OS is started) are upstart, systemd, etc.

matt b
  • 132,562
  • 64
  • 267
  • 334
1

A Windows Service is basically a background task that runs a process for you. In Windows, they are typically binary's (.exe's) that can hook into the Windows Service platform for startup and shutdown messages from the OS (and the services administration screen).

Anytime you execute Java, you need runtime component (JVM) to run it. Even Websphere and the other app servers are running in a JVM.

There isn't anything in Linux for you to hook into a "Service" per say, but you can emulate the functionality and run startup items in Linux at boot time.

Mike
  • 3,076
  • 3
  • 24
  • 28