Jbang Page

jBang



Return to Java developer tools

JBang provides a way to get started with Java that is unmatched in simplicity compared to not just any other Java-based approach but better than Python, node.js, Go and more.

Once down the path of the JBang Way you will be able to explore API's new and old in ways before believed to be beyond reach.

JBang lets Students, Educators and Professional Developers create, edit and run self-contained source-only Java programs with unprecedented ease. It is a is a tool for building and running .java/.jsh scripts and jar packages.

https://www.jbang.dev

https://github.com/jbangdev/jbang

https://github.com/fbricon/jbang-catalog/blob/ee8fc4c84a0f35a645bcdf008600a58753e872f0/lastweek.java

https://github.com/jbangdev/jbang-python

https://github.com/jbangdev/jbang-action

https://xam.dk/blog/jdbc

https://xam.dk/blog/dynamic-github-readme-with-jbang-quarkus



{{youtube>u0kWB9S_np0}}

https://www.youtube.com/watch?v=u0kWB9S_np0

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 ? Ever tried out Java 11+ support for running .java files directly in your shell but felt it was a bit too cumbersome ?


Installation on Windows



To use it Download or Install JBang or run the following command from any bash compatible terminal:

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

or in a Windows Powershell:

iex "& { $(iwr https://ps.jbang.dev) } app setup

* choco install jbang -y

Chocolatey v1.0.0

Installing the following packages:

jbang

By installing, you accept licenses for the packages.

Progress: Downloading jbang 0.92.2... 100%

jbang v0.92.2 [Approved]

jbang package files install completed. Performing other installation steps.

The package jbang wants to run 'chocolateyinstall.ps1'.

Downloading jbang

from 'https://github.com/jbangdev/jbang - /releases/download/v0.92.2/jbang-0.92.2.zip'

Progress: 100% - Completed download of C:\Users\USERNAME\AppData\Local\Temp\chocolatey\jbang\0.92.2\jbang-0.92.2.zip (5.51 MB).

Download of jbang-0.92.2.zip (5.51 MB) completed.

Hashes match.

Extracting C:\Users\USERNAME\AppData\Local\Temp\chocolatey\jbang\0.92.2\jbang-0.92.2.zip to C:\ProgramData\chocolatey\lib\jbang...

C:\ProgramData\chocolatey\lib\jbang

Added C:\ProgramData\chocolatey\bin\jbang.exe shim pointed to '..\lib\jbang\jbang-0.92.2\bin\jbang.cmd'.

The install of jbang was successful.

Software installed to 'C:\ProgramData\chocolatey\lib\jbang'

Chocolatey installed 1/1 packages.

See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

PS C:\Users\USERNAME> jbang


Help



jbang is a tool for building and running .java/.jsh scripts and jar packages.

Usage: jbang [-hV] [--config=] [--verbose | --quiet] [-o | --fresh]
[COMMAND]

jbang init hello.java [args...] (to initialize a script)

or jbang edit --open=code --live hello.java (to edit a script in IDE with live updates)

or jbang hello.java [args...] (to run a .java file)

or jbang gavsearch@jbangdev [args...] (to run a alias from a catalog)

or jbang group-id:artifact-id:version [args...] (to run a .jar file found with a GAV id)

--config= Path to config file to be used instead of the default
--fresh Make sure we use fresh (i.e. non-cached) resources.
-h, --help Display help/info. Use 'jbang -h' for
detailed usage.
-o, --offline Work offline. Fail-fast if dependencies are missing.
No connections will be attempted
--quiet jbang will be quiet, only print when error occurs.
-V, --version Display version info (use `jbang --verbose version`
for more details)
--verbose jbang will be verbose on what it does.

Essentials:
* jbang run Builds and runs provided script.
* jbang build Compiles and stores script in the cache.

Editing:
* jbang init Initialize a script.
* jbang edit Setup a temporary project to edit script in an IDE.

Caching:
* jbang cache Manage compiled scripts in the local cache.
* jbang export Export the result of a build.
* jbang jdk Manage Java Development Kits installed by jbang.

Configuration:
* jbang config Read and write configuration options.
* jbang trust Manage which domains you trust to run scripts from.
* jbang alias Manage aliases for scripts.
* jbang template Manage templates for scripts.
* jbang catalog Manage Catalogs of aliases.
* jbang app Manage scripts installed on the user's PATH as commands.

Other:
* jbang completion Output auto-completion script for bash/zsh. Usage: source <(jbang completion)

* jbang info Provides info about the script for tools (and humans who are
tools).
* jbang version Display version info.
* jbang wrapper Manage jbang wrapper for a folder.

Copyright: 2020-2022 jbang.dev contributors, ddg>License: MIT

Website: https://jbang.dev