jbang Command Examples

Easily create, edit and run self-contained source-only Java programs. See also: java. More information: https://www.jbang.dev/documentation/guide/latest/cli/jbang.html.

jbang init {{path/to/file.java}}

jbang init --template={{cli}} {{path/to/file.java}}

jbang run --interactive

jbang edit --open={{codium|code|eclipse|idea|netbeans|gitpod}} {{path/to/script.java}}

{{echo 'Files.list(Paths.get("/etc")).forEach(System.out::println);'}} | jbang -

jbang {{path/to/file.java}} {{command}} {{arg1 arg2 ...}}

jbang app install --name {{command_name}} {{path/to/script.java}}

jbang jdk install {{version}}