A POSIX sh command-language interpreter in pure Java 21, buildable as a
GraalVM native image.
io.github.andreoss:sh4j is on Maven Central.
<dependency>
<groupId>io.github.andreoss</groupId>
<artifactId>sh4j</artifactId>
<version>1.0.7</version>
</dependency>java -cp target/classes io.github.andreoss.sh4j.Main -c 'echo hello'
java -cp target/classes io.github.andreoss.sh4j.Main script.sh arg1 arg2
java -cp target/classes io.github.andreoss.sh4j.Main -iNative image, with a GraalVM JDK:
mvn package -Pnative-image
./target/sh4j -c 'echo hello'Copyright (c) 2024-2026. LGPL-3.0-or-later, see LICENSE.txt and COPYING.