Skip to content
andreossPublic

About

An embeddable POSIX sh implemented in Java

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

448 Commits

Folders and files

Repository files navigation

sh4j

A POSIX sh command-language interpreter in pure Java 21, buildable as a GraalVM native image.

Install

io.github.andreoss:sh4j is on Maven Central.

<dependency>
  <groupId>io.github.andreoss</groupId>
  <artifactId>sh4j</artifactId>
  <version>1.0.7</version>
</dependency>

Build

mvn compile

Test

mvn test
mvn jacoco:report

The coverage report is written to target/site/jacoco/index.html.

Run

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 -i

Native image, with a GraalVM JDK:

mvn package -Pnative-image
./target/sh4j -c 'echo hello'

Licence

Copyright (c) 2024-2026. LGPL-3.0-or-later, see LICENSE.txt and COPYING.

About

An embeddable POSIX sh implemented in Java

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Used by

Contributors

Languages