Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Good Java Process Control Library [closed]

Java process control is notoriously bad - primarily due to inadequate support by the Java VM/JDK classes (e.g. java.lang.Process).

I am wondering, are there any good open source libraries out there that are reliable.

The requirements would be:

  1. OSS
  2. Start/Stop processes
  3. Manage STDIN and STDOUT
  4. cross platform (at least Linux, Windows, Solaris, HP, and IBM in that order)
  5. (optional) restartable
  6. (desirable) mature
like image 749
Taylor Gautier Avatar asked Oct 10 '08 21:10

Taylor Gautier


People also ask

How do I stop a ProcessBuilder in Java?

You can call destroy() method on it.

How would you troubleshoot a hang issue in a Java application?

If the application appears to be hung and the process appears to be idle, then the first step is to try to get a thread dump. If the application console is available, then press Control+\ (on Oracle Solaris or Linux), or Control+Break (on Windows) to cause the HotSpot VM to print a thread dump.

How do you start a process in Java?

Process process = new ProcessBuilder("processname"). start();

What is Java running process?

The Process is an abstract class defined in the java. lang package that encapsulates the runtime information of a program in execution. The exec method invoked by the Runtime instance returns a reference to this class instance. There is an another way to create an instance of this class, through the ProcessBuilder.


2 Answers

How about Apache Commons Exec?

like image 168
Michelle Tilley Avatar answered Sep 28 '22 11:09

Michelle Tilley


Java Service Wrapper might be what you're looking for. It's cross-platform, can be used to start things as a Windows service, capture IO, and generally completely manage any java app. It's very light weight and well designed. Atlassian uses it to wrap their products (Jira, Bamboo, etc), so it's battle tested.

like image 45
Trenton Avatar answered Sep 28 '22 12:09

Trenton