By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
World of SoftwareWorld of SoftwareWorld of Software
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Search
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
Reading: JBang Jash Brings Streamlined Process Execution to Java
Share
Sign In
Notification Show More
Font ResizerAa
World of SoftwareWorld of Software
Font ResizerAa
  • Software
  • Mobile
  • Computing
  • Gadget
  • Gaming
  • Videos
Search
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Have an existing account? Sign In
Follow US
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
World of Software > News > JBang Jash Brings Streamlined Process Execution to Java
News

JBang Jash Brings Streamlined Process Execution to Java

News Room
Last updated: 2025/05/09 at 11:21 AM
News Room Published 9 May 2025
Share
SHARE

The JBang team has introduced JBang Jash (pronounced Jazz), a Java library designed to simplify the execution of external processes and shell commands through a fluent and predictable API, aiming to addresses the common complexities and boilerplate developers face when using standard Java APIs like ProcessBuilder and the overloaded exec() method, defined in Runtime, for these tasks.

JBang Jash aims to facilitate intuitive and chainable process execution, automatically handling the underlying management of input/output streams. Non-zero exit codes are handled as exceptions by default, a behavior which can be customized. It also supports piping commands in a pipeline, eliminating the needs of manual stream forwarding, and also detects the appropriate shell environment, such as Bash, CMD, or Powershell, based on the operation system.

Let’s see a shell example using pure Java that requires manual stream handling, and explicit error checking, the example just run the “git status” and capture the output:


//without Jash
ProcessBuilder builder = new ProcessBuilder("git", "status");
builder.redirectErrorStream(true);
Process process = builder.start();

BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line;
while ((line = reader.readLine()) != null) {
   System.out.println(line);
}

int exitCode = process.waitFor();
if (exitCode != 0) {
   throw new RuntimeException("Process exited with error code " + exitCode);
}

and with Jash:


Jash.start("git", "status").stream().forEach(System.out::println);

Let’s also see an example of how to piping commands in Java, where a lowercase text is transformed to uppercase by piping the output of echo into the tr command:


//without Jash
ProcessBuilder echoBuilder = new ProcessBuilder("echo", "hello world");
Process echoProcess = echoBuilder.start();

ProcessBuilder trBuilder = new ProcessBuilder("tr", "a-z", "A-Z");
Process trProcess = trBuilder.start();

try (
      BufferedReader reader = new BufferedReader(new InputStreamReader(echoProcess.getInputStream()));
      BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(trProcess.getOutputStream()))
) {
   String line;
   while ((line = reader.readLine()) != null) {
      writer.write(line);
      writer.newLine();
   }
   writer.flush();
   trProcess.getOutputStream().close(); // signal EOF to tr
}

int echoExit = echoProcess.waitFor();
int trExit = trProcess.waitFor();

if (echoExit != 0) {
   throw new RuntimeException("echo failed with code " + echoExit);
}

try (BufferedReader resultReader = new BufferedReader(new InputStreamReader(trProcess.getInputStream()))) {
   String line;
   while ((line = resultReader.readLine()) != null) {
      System.out.println(line); // Expected: HELLO WORLD
   }
}

if (trExit != 0) {
   throw new RuntimeException("tr failed with code " + trExit);
}

and with Jash:


String result = Jash.start("echo", "hello world")
      .pipe("tr", "a-z", "A-Z")
      .get();

System.out.println(result.trim()); // Outputs: HELLO WORLD

JBang Jash is based on a project named “fluent-process” by OnGres, Inc. in 2020. After years without an official release, the project was forked and renamed to “jash” (a reference to Java and Shell) in 2025 to reflect its focus on providing a more idiomatic Java 17+ interface for working with shell processes and streams.

It is important to note that Jash can be integrated to any Java Project, without needing to use the JBang CLI tool.

More examples and details about JBang Jash can be found in the GitHub repository.

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Twitter Email Print
Share
What do you think?
Love0
Sad0
Happy0
Sleepy0
Angry0
Dead0
Wink0
Previous Article DingTalk launches immersive workplace for Apple Vision Pro · TechNode
Next Article Samsung Odyssey OLED G8 G81SF 4K UHD HDR Monitor Review
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

248.1k Like
69.1k Follow
134k Pin
54.3k Follow

Latest News

Crypto industry brushes off failed stablecoin vote
News
UK broadband hits 2025 target with strong first quarter | Computer Weekly
News
Samsung Galaxy Ring deal: Get a $100 gift card with your purchase!
News
Paycom Software, Inc. Beat win expectations and analysts now have new predictions
News

You Might also Like

News

Crypto industry brushes off failed stablecoin vote

6 Min Read
News

UK broadband hits 2025 target with strong first quarter | Computer Weekly

4 Min Read
News

Samsung Galaxy Ring deal: Get a $100 gift card with your purchase!

4 Min Read
News

Paycom Software, Inc. Beat win expectations and analysts now have new predictions

6 Min Read
//

World of Software is your one-stop website for the latest tech news and updates, follow us now to get the news that matters to you.

Quick Link

  • Privacy Policy
  • Terms of use
  • Advertise
  • Contact

Topics

  • Computing
  • Software
  • Press Release
  • Trending

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

World of SoftwareWorld of Software
Follow US
Copyright © All Rights Reserved. World of Software.
Welcome Back!

Sign in to your account

Lost your password?