JBang Documentation

JBang Logo

Want to learn, explore or use Java instantly without setup?

Do you like Java but use Python, Groovy, Kotlin or similar languages for scripts, experimentation and exploration?

Ever wanted to just be able to run Java from anywhere without any or very minimal setup?

Then try JBang - the tool that makes Java scripting easy and fun!

Quick Start

# Install JBang
curl -Ls https://sh.jbang.dev | bash -s - app setup

# Create your first script
jbang init --template=cli hello.java

# Run it
jbang hello.java Max!

4AiobRxUwPUPztCtrDYcmoKjs

What is JBang?

JBang is a tool that makes it easy to write and run Java scripts without the traditional setup overhead. It goes beyond simple scripting - you can use JBang to launch any Java application or library packaged as a JAR, available locally, via HTTP/HTTPS download, or in a Maven repository.

Key Features

Feature Description

Zero Setup

Run Java files directly - no project setup needed

Dependency Management

Declare dependencies with //DEPS - automatic resolution

Multiple Languages

Support for .java, .jsh, .kt, .groovy, and .md files

Native Images

Generate native binaries with GraalVM

IDE Integration

Edit with full IDE support using jbang edit

Templates

Quick start with built-in templates

Aliases & Catalogs

Share and reuse scripts easily

Cross Platform

Works on Windows, macOS, Linux, and AIX

Documentation Guide

🚀 Getting Started

Perfect for newcomers to JBang:

📝 Writing Scripts

Learn to write effective JBang scripts:

🔧 Advanced Features

Explore powerful JBang capabilities:

⚙️ Configuration & Tools

Configure JBang for your workflow:

🆘 Help & Reference

When you need assistance:

Common Use Cases

Use Case Example

Quick Scripts

jbang script.java - Run any Java file instantly

Command Line Tools

jbang init --template=cli mytool.java - Build CLI apps

Experiments

jbang --deps com.fasterxml.jackson.core:jackson-core:2.15.2 experiment.java

Learning

jbang --jsh - Interactive Java shell

Prototyping

jbang edit myapp.java - Full IDE support for rapid development

Requirements

JBang requires Java 8 or higher (Java 17+ recommended). If Java is not available in PATH or JAVA_HOME, JBang will automatically download and install it from Eclipse Temurin.

Tested and verified on:

  • 🐧 Linux

  • 🍎 macOS

  • 🪟 Windows (Command Prompt, PowerShell, WSL)

  • 🔧 AIX

Community

Next Steps

  1. New to JBang? → Start with Installation

  2. Want to dive in? → Try First Script

  3. Building something complex? → Check Dependencies

  4. Need help? → Visit the FAQ

Ready to unleash the power of Java scripting? Let’s get started! 🚀