SkillAgentSearch skills...

Blaze

Write your shell scripts on the JVM (java, kotlin, groovy, etc.)

Install / Use

/learn @fizzed/Blaze
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Blaze by Fizzed

Maven Central

Automated Testing

The following Java versions and platforms are tested using GitHub workflows:

Java 8 Java 11 Java 17 Java 21 Java 25

Linux x64 MacOS arm64 Windows x64

The following platforms are tested using the Fizzed, Inc. build system:

FreeBSD x64 FreeBSD arm64 Linux arm64 Linux armhf Linux riscv64 Linux MUSL x64 Linux MUSL arm64 Linux MUSL riscv64 MacOS x64 OpenBSD x64 OpenBSD arm64 Windows arm64

Overview

A speedy, flexible, general purpose scripting and application launching stack for the JVM. Can replace shell scripts and plays nicely with other tools. Only requires a Java 8 runtime and adding blaze.jar to your project directory. Start writing portable and cross-platform scripts.

Blaze pulls together stable, mature libraries from the Java ecosystem into a light-weight package that lets you focus on getting things done. When you invoke blaze, it does the following:

  • Sets up console logging
  • Loads your optional configuration file(s)
  • Downloads runtime dependencies (e.g. jars from Maven central)
  • Loads and compiles your script(s)
  • Executes "tasks" (methods your script defines)

Includes the following features:

  • Write your applications (scripts) in whatever JVM language you prefer. Out-of-the-box support for
    • Java (.java) (8, 11, 17, 21, etc.)
    • Groovy (.groovy) (v4.0.15)
    • Kotlin (.kt) (v1.9.10)
    • JavaScript (.js) (via nashorn on Java 11+)
    • Or write your own (examples here, here, and here)
  • Zero-install required. Just drop blaze.jar into your project directory and you or others can run it with java -jar blaze.jar.
  • IDE support
  • Small size so you can commit blaze.jar to your repository
  • Excellent framework support for executing processes, modifying the filesystem, user interaction, http, and ssh.
  • Easily use any Java library as a dependency to accomplish whatever the framework doesn't provide.

Sponsorship & Support

Project by Fizzed, Inc. (Follow on Twitter: @fizzed_inc)

Developing and maintaining opensource projects requires significant time. If you find this project useful or need commercial support, we'd love to chat. Drop us an email at ping@fizzed.com

Project sponsors may include the following benefits:

  • Priority support (outside of Github)
  • Feature development & roadmap
  • Priority bug fixes
  • Privately hosted continuous integration tests for their unique edge or use cases

What is a blaze script?

A Blaze script is a 100% valid JVM class with public methods that typically uses an empty (root) package declaration. Each public method becomes the externally accessible task that can be called from the command-line. Since most JVM languages support this kind of structure, Blaze can easily support a wide variety of JVM languages.

More documentation

Try It

To give this project a quick try on your own machine, just run some of the examples:

git clone https://github.com/fizzed/blaze.git
cd blaze
java -jar blaze.jar examples/hello.java
java -jar blaze.jar examples/natives.java
java -jar blaze.jar examples/find_javas.java

Install to your project

Download blaze.jar to your project directory. If you have wget available

wget -O blaze.jar 'https://repo1.maven.org/maven2/com/fizzed/blaze-lite/2.11.0/blaze-lite-2.11.0.jar'

If you have curl available

curl -o blaze.jar 'https://repo1.maven.org/maven2/com/fizzed/blaze-lite/2.11.0/blaze-lite-2.11.0.jar'

Or simply download the file in your web browser and save it to your project directory with a name of blaze.jar

Write hello world blaze script in .java

Create blaze.java file

public class blaze {
    
    public void main() {
        System.out.println("Hello World!");
    }
    
}

Run blaze script

Since you named your file blaze.java, Blaze will find it automatically. You can run it like so

java -jar blaze.jar

If no task is supplied on the command line, Blaze will attempt to run the main task by default.

Write script that executes a process

Let's do a more useful example of how we use Blaze in many cases. Let's say you had a Maven project and wanted to execute a class with a main method. The syntax to do that in Maven becomes difficult to remember and communicate to other developers. Blaze lets you simplify the entry points to your project by exposing everything as named tasks.

import static com.fizzed.blaze.Systems.exec;

public class blaze {

    public void demo1() {
        exec(
           "mvn", "compile", "exec:java", "-Dexec.classpathScope=runtime",
           "-Dexec.mainClass=com.example.Demo1").run();
    }

    public void demo2() {
        exec(
           "mvn", "compile", "exec:java", "-Dexec.classpathScope=runtime",
           "-Dexec.mainClass=com.example.Demo2").run();
    }
}

You can now just run these with java -jar blaze.jar demo1 or java -jar blaze.jar demo2

Avoid "Terminate batch job (Y/N)" on CTRL+C in Windows

If you leverage powershell on Windows, Blaze v1.6.0+ will install a blaze.ps1 via the "-i" installer flag. This powershell script will help you avoid the infuriating "Terminate batch job (Y/N)" prompt on Windows.

Avoid zombie processes triggered with maven and CTRL+C on Windows

On windows if you run maven, and it in turn creates child processes for javadocs, exec plugin, etc., in almost all cases, maven will close but leave the processes it opened still running. The problem is that Windows itself does not close the process hierarchy if the parent is terminated, like Linux or MacOS will do.

As of Blaze v1.6.0+, any blaze exec() action will automatically destroy any running processes as well as any child processes upon shutdown via CTRL+C (or any reason for an exit). Blaze makes Maven on Windows much easier to use.

But I can still do your previous example in a shell script?

Yeah, I suppose so. But you'd probably use two shell scripts to define the separate tasks and if you cared about platform portability, you'd be nice to also include .bat scripts for Windows users. However, when you want to d

Related Skills

View on GitHub
GitHub Stars148
CategoryDevelopment
Updated6d ago
Forks14

Languages

Java

Security Score

85/100

Audited on Apr 1, 2026

No findings