Unpacking Software Livestream

Join our monthly Unpacking Software livestream to hear about the latest news, chat and opinion on packaging, software deployment and lifecycle management!

Learn More

Chocolatey Product Spotlight

Join the Chocolatey Team on our regular monthly stream where we put a spotlight on the most recent Chocolatey product releases. You'll have a chance to have your questions answered in a live Ask Me Anything format.

Learn More

Chocolatey Coding Livestream

Join us for the Chocolatey Coding Livestream, where members of our team dive into the heart of open source development by coding live on various Chocolatey projects. Tune in to witness real-time coding, ask questions, and gain insights into the world of package management. Don't miss this opportunity to engage with our team and contribute to the future of Chocolatey!

Learn More

Calling All Chocolatiers! Whipping Up Windows Automation with Chocolatey Central Management

Webinar from
Wednesday, 17 January 2024

We are delighted to announce the release of Chocolatey Central Management v0.12.0, featuring seamless Deployment Plan creation, time-saving duplications, insightful Group Details, an upgraded Dashboard, bug fixes, user interface polishing, and refined documentation. As an added bonus we'll have members of our Solutions Engineering team on-hand to dive into some interesting ways you can leverage the new features available!

Watch On-Demand
Chocolatey Community Coffee Break

Join the Chocolatey Team as we discuss all things Community, what we do, how you can get involved and answer your Chocolatey questions.

Watch The Replays
Chocolatey and Intune Overview

Webinar Replay from
Wednesday, 30 March 2022

At Chocolatey Software we strive for simple, and teaching others. Let us teach you just how simple it could be to keep your 3rd party applications updated across your devices, all with Intune!

Watch On-Demand
Chocolatey For Business. In Azure. In One Click.

Livestream from
Thursday, 9 June 2022

Join James and Josh to show you how you can get the Chocolatey For Business recommended infrastructure and workflow, created, in Azure, in around 20 minutes.

Watch On-Demand
The Future of Chocolatey CLI

Livestream from
Thursday, 04 August 2022

Join Paul and Gary to hear more about the plans for the Chocolatey CLI in the not so distant future. We'll talk about some cool new features, long term asks from Customers and Community and how you can get involved!

Watch On-Demand
Hacktoberfest Tuesdays 2022

Livestreams from
October 2022

For Hacktoberfest, Chocolatey ran a livestream every Tuesday! Re-watch Cory, James, Gary, and Rain as they share knowledge on how to contribute to open-source projects such as Chocolatey CLI.

Watch On-Demand

Downloads:

45,805

Downloads of v 0.123.0:

2,684

Last Update:

25 Jan 2025

Package Maintainer(s):

Software Author(s):

  • Max Rydahl Andersen

Tags:

jbang bash java shell scripting

JBang

  • 1
  • 2
  • 3

0.123.0 | Updated: 25 Jan 2025

Downloads:

45,805

Downloads of v 0.123.0:

2,684

Maintainer(s):

Software Author(s):

  • Max Rydahl Andersen

JBang 0.123.0

Legal Disclaimer: Neither this package nor Chocolatey Software, Inc. are affiliated with or endorsed by Max Rydahl Andersen. The inclusion of Max Rydahl Andersen trademark(s), if any, upon this webpage is solely to identify Max Rydahl Andersen goods or services and not for commercial purposes.

  • 1
  • 2
  • 3

All Checks are Passing

3 Passing Tests


Validation Testing Passed


Verification Testing Passed

Details

Scan Testing Successful:

No detections found in any package files

Details
Learn More

Deployment Method: Individual Install, Upgrade, & Uninstall

To install JBang, run the following command from the command line or from PowerShell:

>

To upgrade JBang, run the following command from the command line or from PowerShell:

>

To uninstall JBang, run the following command from the command line or from PowerShell:

>

Deployment Method:

NOTE

This applies to both open source and commercial editions of Chocolatey.

1. Enter Your Internal Repository Url

(this should look similar to https://community.chocolatey.org/api/v2/)


2. Setup Your Environment

1. Ensure you are set for organizational deployment

Please see the organizational deployment guide

2. Get the package into your environment

  • Open Source or Commercial:
    • Proxy Repository - Create a proxy nuget repository on Nexus, Artifactory Pro, or a proxy Chocolatey repository on ProGet. Point your upstream to https://community.chocolatey.org/api/v2/. Packages cache on first access automatically. Make sure your choco clients are using your proxy repository as a source and NOT the default community repository. See source command for more information.
    • You can also just download the package and push it to a repository Download

3. Copy Your Script

choco upgrade jbang -y --source="'INTERNAL REPO URL'" [other options]

See options you can pass to upgrade.

See best practices for scripting.

Add this to a PowerShell script or use a Batch script with tools and in places where you are calling directly to Chocolatey. If you are integrating, keep in mind enhanced exit codes.

If you do use a PowerShell script, use the following to ensure bad exit codes are shown as failures:


choco upgrade jbang -y --source="'INTERNAL REPO URL'" 
$exitCode = $LASTEXITCODE

Write-Verbose "Exit code was $exitCode"
$validExitCodes = @(0, 1605, 1614, 1641, 3010)
if ($validExitCodes -contains $exitCode) {
  Exit 0
}

Exit $exitCode

- name: Install jbang
  win_chocolatey:
    name: jbang
    version: '0.123.0'
    source: INTERNAL REPO URL
    state: present

See docs at https://docs.ansible.com/ansible/latest/modules/win_chocolatey_module.html.


chocolatey_package 'jbang' do
  action    :install
  source   'INTERNAL REPO URL'
  version  '0.123.0'
end

See docs at https://docs.chef.io/resource_chocolatey_package.html.


cChocoPackageInstaller jbang
{
    Name     = "jbang"
    Version  = "0.123.0"
    Source   = "INTERNAL REPO URL"
}

Requires cChoco DSC Resource. See docs at https://github.com/chocolatey/cChoco.


package { 'jbang':
  ensure   => '0.123.0',
  provider => 'chocolatey',
  source   => 'INTERNAL REPO URL',
}

Requires Puppet Chocolatey Provider module. See docs at https://forge.puppet.com/puppetlabs/chocolatey.


4. If applicable - Chocolatey configuration/installation

See infrastructure management matrix for Chocolatey configuration elements and examples.

NOTE

Private CDN cached downloads available for licensed customers. Never experience 404 breakages again! Learn more...

Package Approved

This package was approved as a trusted package on 25 Jan 2025.

Description

Want to learn or explore Java instantly without setup ?

Do you like Java but uses python, groovy, kotlin or similar languages for your scripts ?

Ever tried out Java 11+ support for running .java files directly in your shell but felt it was a bit too cumbersome ?

Then try jbang which lets you do this:

asciicast

$ jbang --init=cli hello.java
$ jbang hello.java Max!
[jbang] Resolving dependencies...
[jbang] Resolving info.picocli:picocli:4.6.3...Done
[jbang] Dependencies resolved
[jbang] Building jar...
Hello Max!
$ jbang hello.java -h
Usage: hello [-hV] <greeting>
hello made with jbang
<greeting> The greeting to print
-h, --help Show this help message and exit.
-V, --version Print version information and exit.

Instant cli app generated built using java and picocli as a dependency that was fetched as needed for the compilation and execution.

Features

  • .java Scripting for Java 8 and upwards
  • .jsh via JShell from Java 9 and upwards
  • Works on icon:windows[] Windows, icon:apple[] OSX and icon:linux[] Linux
  • Install using SDKMan (icon:apple[]/icon:linux[]), Homebrew (icon:apple[]), Chocolatey (icon:windows[]) or Scoop (icon:windows[])
  • Dependency declarations using //DEPS &lt;gav&gt; for automatic dependency resolution
  • Control compile and runtime options with //COMPILE_OPTIONS &lt;flags&gt; and //RUNTIME_OPTIONS &lt;flags&gt;
  • Compiled jar and Dependency resolution caching
  • Launch with debug enabled for instant debugging from your favorite IDE
  • Init templates to get started easily (jbang --init=cli hello.java)
  • Generate gradle and IDE config with dependencies for easy editing in your favorite IDE (jbang edit myfile.java)
  • (PLANNED) Lookup dependencies with a short-hand name, i.e. // DEPS log4j:1.2+,picocli for quick getting started.

To use it simply install jbang and run jbang yourscript.java


tools\chocolateyinstall.ps1
$tools = Split-Path $MyInvocation.MyCommand.Definition
$package = Split-Path $tools
$jbang_home = Join-Path $package 'jbang-0.123.0'
$jbang_bat = Join-Path $jbang_home 'bin/jbang.cmd'

Install-ChocolateyZipPackage `
    -PackageName 'jbang' `
    -Url 'https://github.com/jbangdev/jbang/releases/download/v0.123.0/jbang-0.123.0.zip' `
    -Checksum 'f77e3c1962c321bb68b62c105e6c06a59a0fbc7a1ca32274c15a6ca2466242db' `
    -ChecksumType 'sha256' `
    -UnzipLocation $package

Install-BinFile -Name 'jbang' -Path $jbang_bat
tools\chocolateyuninstall.ps1
$tools = Split-Path $MyInvocation.MyCommand.Definition
$package = Split-Path $tools
$jbang_home = Join-Path $package 'jbang-0.123.0'
$jbang_bat = Join-Path $jbang_home 'bin/jbang.cmd'

Uninstall-BinFile -Name 'jbang' -Path $jbang_bat
tools\LICENSE.txt
From: https://raw.githubusercontent.com/jbangdev/jbang/HEAD/LICENSE

MIT License

Copyright (c) 2020 Max Rydahl Andersen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
tools\VERIFICATION.txt

VERIFICATION
Verification is intended to assist the Chocolatey moderators and community
in verifying that this package's contents are trustworthy.
 
You can verify the files are same as the one coming from the main repo
at https://github.com/jbangdev/jbang/releases.

Log in or click on link to see number of positives.

In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).

Chocolatey Pro provides runtime protection from possible malware.

Add to Builder Version Downloads Last Updated Status
JBang 0.122.0 1107 Monday, December 16, 2024 Approved
JBang 0.121.0 995 Saturday, November 16, 2024 Approved
JBang 0.120.4 24 Saturday, November 16, 2024 Approved
JBang 0.119.0 1643 Friday, September 27, 2024 Approved
JBang 0.118.0 446 Thursday, September 12, 2024 Approved
JBang 0.117.1 2412 Sunday, July 7, 2024 Approved
JBang 0.117.0 32 Sunday, July 7, 2024 Approved
JBang 0.116.0 3293 Monday, April 1, 2024 Approved
JBang 0.115.0 634 Saturday, March 9, 2024 Approved
JBang 0.114.0 3092 Saturday, December 9, 2023 Approved
JBang 0.113.0 541 Friday, November 24, 2023 Approved
JBang 0.112.4 352 Sunday, November 19, 2023 Approved
JBang 0.111.0 1587 Saturday, September 30, 2023 Approved
JBang 0.110.1 1097 Thursday, August 17, 2023 Approved
JBang 0.110.0 1089 Sunday, July 23, 2023 Approved
JBang 0.109.0 289 Saturday, July 8, 2023 Approved
JBang 0.108.0 935 Saturday, June 10, 2023 Approved
JBang 0.107.0 1359 Tuesday, May 16, 2023 Approved
JBang 0.106.3 640 Sunday, April 16, 2023 Approved
JBang 0.106.1 180 Saturday, April 1, 2023 Approved
JBang 0.105.2 150 Friday, March 24, 2023 Approved
JBang 0.105.1 173 Monday, March 20, 2023 Approved
JBang 0.104.0 205 Friday, February 24, 2023 Approved
JBang 0.103.2 91 Sunday, February 19, 2023 Approved
JBang 0.103.1 89 Tuesday, February 14, 2023 Approved
JBang 0.103.0 102 Saturday, February 11, 2023 Approved
JBang 0.102.0 165 Wednesday, January 18, 2023 Approved
JBang 0.101.0 262 Friday, November 25, 2022 Approved
JBang 0.100.1 112 Thursday, November 17, 2022 Approved
JBang 0.100.0 184 Tuesday, November 8, 2022 Approved
JBang 0.99.1 199 Thursday, October 13, 2022 Approved
JBang 0.98.0 286 Friday, September 2, 2022 Approved
JBang 0.97.0 246 Wednesday, August 10, 2022 Approved
JBang 0.96.3 100 Wednesday, August 3, 2022 Approved
JBang 0.96.1 87 Tuesday, August 2, 2022 Approved
JBang 0.96.0 173 Thursday, July 14, 2022 Approved
JBang 0.95.0 225 Thursday, June 9, 2022 Approved
JBang 0.94.0 199 Friday, May 13, 2022 Approved
JBang 0.92.2 228 Sunday, March 20, 2022 Approved
JBang 0.92.1 109 Saturday, March 19, 2022 Approved
JBang 0.92.0 86 Friday, March 18, 2022 Approved
JBang 0.91.0 118 Thursday, March 10, 2022 Approved
JBang 0.90.2 114 Thursday, March 3, 2022 Approved
JBang 0.90.1 154 Sunday, February 20, 2022 Approved
JBang 0.90.0 105 Friday, February 18, 2022 Approved
JBang 0.88.0 142 Friday, February 4, 2022 Approved
JBang 0.87.0 131 Friday, January 21, 2022 Approved
JBang 0.86.0 205 Sunday, January 2, 2022 Approved
JBang 0.85.1 114 Tuesday, December 28, 2021 Approved
JBang 0.85.0 107 Friday, December 24, 2021 Approved
JBang 0.84.2 159 Saturday, December 11, 2021 Approved
JBang 0.84.1 74 Friday, December 10, 2021 Approved
JBang 0.83.1 197 Saturday, November 13, 2021 Approved
JBang 0.83.0 90 Wednesday, November 3, 2021 Approved
JBang 0.82.1 137 Sunday, October 31, 2021 Approved
JBang 0.82.0 100 Saturday, October 30, 2021 Approved
JBang 0.81.2 157 Thursday, October 7, 2021 Approved
JBang 0.81.1 124 Monday, October 4, 2021 Approved
JBang 0.81.0 119 Saturday, October 2, 2021 Approved
JBang 0.80.2 136 Thursday, September 23, 2021 Approved
j'bang 0.80.1 103 Tuesday, September 21, 2021 Approved
j'bang 0.80.0 100 Tuesday, September 21, 2021 Approved
j'bang 0.77.0 209 Thursday, July 15, 2021 Approved
j'bang 0.72.0 158 Friday, June 25, 2021 Approved
j'bang 0.71.1 185 Tuesday, May 25, 2021 Approved
j'bang 0.70.0 188 Thursday, April 8, 2021 Approved
j'bang 0.69.2 136 Thursday, March 25, 2021 Approved
j'bang 0.69.1 144 Wednesday, March 24, 2021 Approved
j'bang 0.68.0 132 Saturday, March 20, 2021 Approved
j'bang 0.67.3 140 Sunday, March 14, 2021 Approved
j'bang 0.67.2 102 Saturday, March 13, 2021 Approved
j'bang 0.67.1 157 Sunday, March 7, 2021 Approved
j'bang 0.67.0 128 Thursday, March 4, 2021 Approved
j'bang 0.66.1 182 Monday, February 15, 2021 Approved
j'bang 0.66.0 148 Friday, February 12, 2021 Approved
j'bang 0.65.1 160 Friday, February 5, 2021 Approved
j'bang 0.65.0 114 Friday, February 5, 2021 Approved
j'bang 0.64.0 136 Thursday, February 4, 2021 Approved
j'bang 0.63.0 175 Sunday, January 24, 2021 Approved
j'bang 0.62.0 137 Sunday, January 17, 2021 Approved
j'bang 0.61.1 146 Thursday, January 14, 2021 Approved
j'bang 0.61.0 166 Thursday, January 14, 2021 Approved
j'bang 0.60.0 147 Sunday, January 10, 2021 Approved
j'bang 0.59.0 165 Friday, January 8, 2021 Approved
j'bang 0.58.0 148 Sunday, January 3, 2021 Approved
j'bang 0.57.0 140 Monday, December 28, 2020 Approved
j'bang 0.56.0 160 Sunday, December 6, 2020 Approved
j'bang 0.55.2 139 Tuesday, December 1, 2020 Approved
j'bang 0.55.1 176 Thursday, November 26, 2020 Approved
j'bang 0.55.0 142 Thursday, November 26, 2020 Approved
j'bang 0.54.1 124 Tuesday, November 24, 2020 Approved
j'bang 0.54.0 143 Sunday, November 22, 2020 Approved
j'bang 0.53.2 163 Monday, November 9, 2020 Approved
j'bang 0.53.1 140 Sunday, November 8, 2020 Approved
j'bang 0.53.0 135 Saturday, November 7, 2020 Approved
j'bang 0.52.1 144 Monday, October 26, 2020 Approved
j'bang 0.52.0 171 Thursday, October 15, 2020 Approved
j'bang 0.51.1 140 Monday, October 12, 2020 Approved
j'bang 0.51.0 153 Saturday, October 10, 2020 Approved
j'bang 0.50.1 139 Friday, October 9, 2020 Approved
j'bang 0.50.0 150 Thursday, October 8, 2020 Approved
j'bang 0.49.0 126 Tuesday, October 6, 2020 Approved
j'bang 0.48.0 168 Thursday, September 24, 2020 Approved
j'bang 0.47.1 174 Monday, September 21, 2020 Approved
j'bang 0.47.0 131 Monday, September 21, 2020 Approved
j'bang 0.46.1 144 Sunday, September 20, 2020 Approved
j'bang 0.46.0 133 Sunday, September 20, 2020 Approved
j'bang 0.45.0 165 Friday, September 11, 2020 Approved
j'bang 0.44.2 141 Tuesday, September 8, 2020 Approved
j'bang 0.44.0 138 Tuesday, September 8, 2020 Approved
j'bang 0.43.0 158 Wednesday, September 2, 2020 Approved
j'bang 0.42.1 142 Wednesday, September 2, 2020 Approved
j'bang 0.42.0 151 Sunday, August 30, 2020 Approved
j'bang 0.41.0 149 Sunday, August 30, 2020 Approved
j'bang 0.40.1 158 Thursday, August 27, 2020 Approved
j'bang 0.40.0 144 Thursday, August 27, 2020 Approved
j'bang 0.39.0 161 Sunday, August 23, 2020 Approved
j'bang 0.38.0 175 Tuesday, August 18, 2020 Approved
j'bang 0.37.0 151 Monday, August 17, 2020 Approved
j'bang 0.36.1 182 Sunday, August 2, 2020 Approved
j'bang 0.36.0 135 Saturday, August 1, 2020 Approved
j'bang 0.35.1 147 Friday, July 31, 2020 Approved
j'bang 0.35.0 144 Friday, July 31, 2020 Approved
j'bang 0.34.1 139 Tuesday, July 28, 2020 Approved
j'bang 0.34.0 167 Sunday, July 26, 2020 Approved
j'bang 0.33.0 166 Tuesday, July 7, 2020 Approved
j'bang 0.32.0 176 Saturday, June 20, 2020 Approved
j'bang 0.31.0 153 Sunday, June 14, 2020 Approved
j'bang 0.30.0 153 Friday, June 12, 2020 Approved
j'bang 0.29.1 153 Saturday, June 6, 2020 Approved
j'bang 0.29.0 151 Saturday, June 6, 2020 Approved
j'bang 0.28.0 142 Thursday, June 4, 2020 Approved
j'bang 0.27.0 168 Monday, June 1, 2020 Approved
j'bang 0.26.0 160 Sunday, May 31, 2020 Approved
j'bang 0.25.0 142 Thursday, May 28, 2020 Approved
j'bang 0.24.0 148 Thursday, May 21, 2020 Approved
j'bang 0.23.0 143 Saturday, May 16, 2020 Approved
j'bang 0.22.0.2 189 Thursday, April 16, 2020 Approved
j'bang 0.21.0 168 Friday, April 10, 2020 Approved
j'bang 0.20.0 190 Sunday, March 22, 2020 Approved
j'bang 0.19.0 192 Thursday, March 5, 2020 Approved
j'bang 0.18.0 164 Saturday, February 29, 2020 Approved
j'bang 0.17.0 178 Monday, February 24, 2020 Approved
j'bang 0.16.2 193 Saturday, February 22, 2020 Approved
j'bang 0.16.1 173 Sunday, February 16, 2020 Approved
j'bang 0.16.0 185 Saturday, February 15, 2020 Approved
j'bang 0.15.1 186 Saturday, February 15, 2020 Approved
j'bang 0.15.0 152 Thursday, February 13, 2020 Approved
j'bang 0.14.2 194 Sunday, February 9, 2020 Approved
j'bang 0.14.1 169 Saturday, February 8, 2020 Approved
j'bang 0.14.0 189 Tuesday, February 4, 2020 Approved
j'bang 0.13.2 160 Wednesday, January 29, 2020 Approved
j'bang 0.13.1 166 Wednesday, January 29, 2020 Approved
j'bang 0.13.0 212 Wednesday, January 29, 2020 Approved
jbang 0.12.2 141 Saturday, January 25, 2020 Approved
jbang 0.12.1 185 Saturday, January 25, 2020 Approved
jbang 0.11.1 138 Wednesday, January 22, 2020 Approved
jbang 0.11.0 144 Wednesday, January 22, 2020 Approved
jbang 0.6.0.5 156 Sunday, January 19, 2020 Approved

This package has no dependencies.

Discussion for the JBang Package

Ground Rules:

  • This discussion is only about JBang and the JBang package. If you have feedback for Chocolatey, please contact the Google Group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or JBang, or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.
comments powered by Disqus