A Java library for executing external processes with improved stream handling, timeouts, exit code checking, and a fluent API.
ZT Process Executor is a Java library that provides an enhanced way to execute and manage external system processes from Java code. It solves common pain points like stream handling, timeout management, and exit code validation by offering a unified API that combines the best features of Java's ProcessBuilder and Apache Commons Exec.
Java developers who need to run external commands or scripts from their applications, especially those dealing with complex process management, logging, or asynchronous execution requirements.
Developers choose ZT Process Executor for its fluent API, comprehensive feature set, and improved reliability over standard Java process execution methods, reducing boilerplate code and handling edge cases like timeouts and stream redirection seamlessly.
ZeroTurnaround Process Executor
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Enables one-liners for complex tasks like capturing output as a string or setting timeouts, reducing boilerplate code compared to standard Java ProcessBuilder.
Built-in SLF4J integration allows easy redirection of process output to loggers via Slf4jStream, as shown in multiple examples for centralized logging.
Automatically destroys processes on timeout with TimeoutException handling, preventing resource leaks and hanging executions without manual cleanup.
Provides enhanced exit code control, allowing custom success values and throwing InvalidExitValueException for failures, improving error handling reliability.
Explicitly lacks process termination features, requiring an additional library (zt-process-killer) for killing processes, which adds complexity for such needs.
Adds an external dependency on SLF4J, which might be unnecessary for projects not using SLF4J or preferring minimal dependency footprints.
Some features like lambda-based line handling are only available in Java 8 and above, limiting use in older Java environments that require backward compatibility.
zt-exec is an open-source alternative to the following products: