GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jbangdev/jbang: Unleash the power of Java - JBang Lets Students, Educators and Professional Developers create, edit and run self-contained source-only Java programs with unprecedented ease.

BranchesTags
Open more actions menu

Latest commit

 

History

2,386 Commits
2,386 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
docs
docs
 
 
examples
examples
 
 
gradle/wrapper
gradle/wrapper
 
 
images
images
 
 
itests
itests
 
 
misc
misc
 
 
site
site
 
 
src
src
 
 
.all-contributorsrc
.all-contributorsrc
 
 
.coderabbit.yaml
.coderabbit.yaml
 
 
.devcontainer.json
.devcontainer.json
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.gitpod.yml
.gitpod.yml
 
 
.justfile
.justfile
 
 
AGENTS.md
AGENTS.md
 
 
CONTRIBUTING.adoc
CONTRIBUTING.adoc
 
 
CONTRIBUTORS.md
CONTRIBUTORS.md
 
 
LICENSE
LICENSE
 
 
RELEASE.md
RELEASE.md
 
 
bisect.sh
bisect.sh
 
 
bootstrap.sh
bootstrap.sh
 
 
build.gradle
build.gradle
 
 
codecov.yml
codecov.yml
 
 
devfile.yaml
devfile.yaml
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
jreleaser.yml
jreleaser.yml
 
 
mise.toml
mise.toml
 
 
pipelines.puml
pipelines.puml
 
 
readme.adoc
readme.adoc
 
 
renovate.json5
renovate.json5
 
 
rewrite.yml
rewrite.yml
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

JBang - Unleash the Power of Java

JBang Logo

Run any JAR or Java source file directly. JBang handles JDK downloads, dependency resolution, compilation, and caching so you can use the full Java ecosystem without the ceremony.

Release Downloads Build Status OpenSSF Scorecard Chat

Get started

curl -Ls https://sh.jbang.dev | bash -s - app setup
jbang init --template=cli hello.java
jbang hello.java Max!

Or install via SDKMan (sdk install jbang), Homebrew (brew install jbangdev/tap/jbang), Chocolatey (choco install jbang), or Scoop (scoop install jbang).

See the installation docs for all options.

4AiobRxUwPUPztCtrDYcmoKjs

What JBang does

At its simplest, JBang runs JARs and Java source files directly from the command line. Point it at a GAV coordinate, a URL, or a local .java file and it takes care of the rest: downloading a JDK if needed, resolving dependencies, compiling, caching, and running.

For single-file programs you declare dependencies with //DEPS comments instead of a build file. That is enough to pull anything from Maven Central (or your own repos) and have it on the classpath.

JBang also works with .jsh (JShell), .kt (Kotlin), .groovy, and .md (Markdown with embedded Java).

Examples

Run any JAR from Maven Central by its GAV coordinate:

jbang com.github.lalyos:jfiglet:0.0.9 "Hello JBang!"

A plain Java file with a naked main (Java 25+):

///usr/bin/env jbang "$0" "$@" ; exit $?
//JAVA 25+

void main(String[] args) {
    System.out.println("Hello " + (args.length > 0 ? args[0] : "World"));
}

A CLI app with a dependency pulled from Maven Central:

///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS info.picocli:picocli:4.6.3
//JAVA 25+

import picocli.CommandLine;
import picocli.CommandLine.Command;
import picocli.CommandLine.Parameters;

@Command(name = "hello", mixinStandardHelpOptions = true)
class hello implements Runnable {
    @Parameters(index = "0", description = "The greeting to print")
    private String greeting;

    void main(String[] args) {
        new CommandLine(new hello()).execute(args);
    }

    public void run() {
        System.out.println("Hello " + greeting);
    }
}

A web server in a single file:

///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS io.javalin:javalin:7.1.0
//DEPS org.slf4j:slf4j-simple:2.0.17
//RUNTIME_OPTIONS -Dorg.slf4j.simpleLogger.defaultLogLevel=info
//JAVA 25+

import io.javalin.Javalin;

void main() {
    Javalin.create(config -> {
        config.useVirtualThreads = true;
        config.router.mount(router -> {
            router.get("/", ctx -> ctx.result("Hello from JBang!"));
        });
    }).start(8000);
}

What else you can do

jbang edit myapp.java              # Open in IDE with full IntelliSense
jbang --debug myapp.java           # Run with debug port open for your IDE
jbang --native myapp.java          # Compile to native binary via GraalVM
jbang app install myapp.java       # Install as a system command
jbang export maven myapp.java      # Export to a Maven project
jbang alias add myapp myapp.java   # Create a short alias
jbang https://gist.github.com/...  # Run scripts from URLs

App Store

JBang can run any Java application packaged as a JAR. The App Store has community-contributed scripts and tools you can run directly.

Documentation

Full user documentation is at jbang.dev/documentation.

There is also an AI-generated technical reference at deepwiki.com/jbangdev/jbang built from the source code.

Community

  • Zulip chat

  • GitHub Issues

  • Example scripts

  • App Store

Contributing

Contributions are welcome. See CONTRIBUTING.adoc for details.

Thanks

JBang was inspired by kscript by Holger Brandl.

JBang is a Commonhaus Foundation project, released under the MIT License.

About

Unleash the power of Java - JBang Lets Students, Educators and Professional Developers create, edit and run self-contained source-only Java programs with unprecedented ease.

jbang.dev

Topics

bashhacktoberfestjavascriptingshell

Resources

Readme
MIT license

Contributing

Contributing
Activity
Custom properties

Stars

1.9k stars

Watchers

24 watching

Forks

216 forks
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.