LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

jbang

runs Java programs as scripts without build tools

TLDR

Run Java script
$ jbang [script.java]
copy
Create new script
$ jbang init [script.java]
copy
Run with dependencies
$ jbang [script.java]
copy
Edit in IDE
$ jbang edit [script.java]
copy
Install as command
$ jbang app install [script.java]
copy
Run from URL
$ jbang [https://example.com/script.java]
copy

SYNOPSIS

jbang [options] command [args]

DESCRIPTION

jbang runs Java programs as scripts without build tools. It handles dependencies, compilation, and execution automatically.
The tool supports inline dependency declarations using comments. It enables shell-script style Java programming.

PARAMETERS

init FILE

Create new script.
run FILE
Run script (default).
edit FILE
Open in IDE.
app install FILE
Install script as app.
--deps GAV
Add Maven dependencies.
--java VERSION
Use specific Java version.
--help
Display help information.

CAVEATS

Requires Java. Dependency download on first run. Scripts use comment directives.

HISTORY

jbang was created by Max Rydahl Andersen to make Java scripting as easy as Python or Bash scripts.

SEE ALSO

java(1), javac(1), groovy(1), kotlin(1)

Copied to clipboard
Kai