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:

27,158

Downloads of v 0.114.0:

2,824

Last Update:

09 Dec 2023

Package Maintainer(s):

Software Author(s):

  • Max Rydahl Andersen

Tags:

jbang bash java shell scripting

JBang

  • 1
  • 2
  • 3

0.114.0 | Updated: 09 Dec 2023

Downloads:

27,158

Downloads of v 0.114.0:

2,824

Maintainer(s):

Software Author(s):

  • Max Rydahl Andersen

JBang 0.114.0

  • 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.114.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.114.0'
end

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


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

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


package { 'jbang':
  ensure   => '0.114.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 09 Dec 2023.

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.114.0'
$jbang_bat = Join-Path $jbang_home 'bin/jbang.cmd'

Install-ChocolateyZipPackage `
    -PackageName 'jbang' `
    -Url 'https://github.com/jbangdev/jbang/releases/download/v0.114.0/jbang-0.114.0.zip' `
    -Checksum '660c7eb2eda888897f20aa5c5927ccfed924f3b86d5f2a2477a7b0235cdc94bb' `
    -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.114.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.113.0 511 Friday, November 24, 2023 Approved
JBang 0.112.4 326 Sunday, November 19, 2023 Approved
JBang 0.111.0 1553 Saturday, September 30, 2023 Approved
JBang 0.110.1 1065 Thursday, August 17, 2023 Approved
JBang 0.110.0 1060 Sunday, July 23, 2023 Approved
JBang 0.109.0 251 Saturday, July 8, 2023 Approved
JBang 0.108.0 906 Saturday, June 10, 2023 Approved
JBang 0.107.0 1330 Tuesday, May 16, 2023 Approved
JBang 0.106.3 607 Sunday, April 16, 2023 Approved
JBang 0.106.1 153 Saturday, April 1, 2023 Approved
JBang 0.105.2 118 Friday, March 24, 2023 Approved
JBang 0.105.1 142 Monday, March 20, 2023 Approved
JBang 0.104.0 171 Friday, February 24, 2023 Approved
JBang 0.103.2 67 Sunday, February 19, 2023 Approved
JBang 0.103.1 64 Tuesday, February 14, 2023 Approved
JBang 0.103.0 73 Saturday, February 11, 2023 Approved
JBang 0.102.0 142 Wednesday, January 18, 2023 Approved
JBang 0.101.0 235 Friday, November 25, 2022 Approved
JBang 0.100.1 84 Thursday, November 17, 2022 Approved
JBang 0.100.0 154 Tuesday, November 8, 2022 Approved
JBang 0.99.1 161 Thursday, October 13, 2022 Approved
JBang 0.98.0 240 Friday, September 2, 2022 Approved
JBang 0.97.0 212 Wednesday, August 10, 2022 Approved
JBang 0.96.3 72 Wednesday, August 3, 2022 Approved
JBang 0.96.1 54 Tuesday, August 2, 2022 Approved
JBang 0.96.0 143 Thursday, July 14, 2022 Approved
JBang 0.95.0 187 Thursday, June 9, 2022 Approved
JBang 0.94.0 159 Friday, May 13, 2022 Approved
JBang 0.92.2 196 Sunday, March 20, 2022 Approved
JBang 0.92.1 62 Saturday, March 19, 2022 Approved
JBang 0.92.0 52 Friday, March 18, 2022 Approved
JBang 0.91.0 87 Thursday, March 10, 2022 Approved
JBang 0.90.2 84 Thursday, March 3, 2022 Approved
JBang 0.90.1 116 Sunday, February 20, 2022 Approved
JBang 0.90.0 72 Friday, February 18, 2022 Approved
JBang 0.88.0 111 Friday, February 4, 2022 Approved
JBang 0.87.0 98 Friday, January 21, 2022 Approved
JBang 0.86.0 162 Sunday, January 2, 2022 Approved
JBang 0.85.1 71 Tuesday, December 28, 2021 Approved
JBang 0.85.0 77 Friday, December 24, 2021 Approved
JBang 0.84.2 125 Saturday, December 11, 2021 Approved
JBang 0.84.1 48 Friday, December 10, 2021 Approved
JBang 0.83.1 157 Saturday, November 13, 2021 Approved
JBang 0.83.0 59 Wednesday, November 3, 2021 Approved
JBang 0.82.1 106 Sunday, October 31, 2021 Approved
JBang 0.82.0 63 Saturday, October 30, 2021 Approved
JBang 0.81.2 128 Thursday, October 7, 2021 Approved
JBang 0.81.1 87 Monday, October 4, 2021 Approved
JBang 0.81.0 83 Saturday, October 2, 2021 Approved
JBang 0.80.2 106 Thursday, September 23, 2021 Approved
j'bang 0.80.1 74 Tuesday, September 21, 2021 Approved
j'bang 0.80.0 66 Tuesday, September 21, 2021 Approved
j'bang 0.77.0 178 Thursday, July 15, 2021 Approved
j'bang 0.72.0 115 Friday, June 25, 2021 Approved
j'bang 0.71.1 147 Tuesday, May 25, 2021 Approved
j'bang 0.70.0 152 Thursday, April 8, 2021 Approved
j'bang 0.69.2 108 Thursday, March 25, 2021 Approved
j'bang 0.69.1 117 Wednesday, March 24, 2021 Approved
j'bang 0.68.0 96 Saturday, March 20, 2021 Approved
j'bang 0.67.3 107 Sunday, March 14, 2021 Approved
j'bang 0.67.2 72 Saturday, March 13, 2021 Approved
j'bang 0.67.1 118 Sunday, March 7, 2021 Approved
j'bang 0.67.0 94 Thursday, March 4, 2021 Approved
j'bang 0.66.1 149 Monday, February 15, 2021 Approved
j'bang 0.66.0 111 Friday, February 12, 2021 Approved
j'bang 0.65.1 104 Friday, February 5, 2021 Approved
j'bang 0.65.0 85 Friday, February 5, 2021 Approved
j'bang 0.64.0 103 Thursday, February 4, 2021 Approved
j'bang 0.63.0 142 Sunday, January 24, 2021 Approved
j'bang 0.62.0 104 Sunday, January 17, 2021 Approved
j'bang 0.61.1 105 Thursday, January 14, 2021 Approved
j'bang 0.61.0 110 Thursday, January 14, 2021 Approved
j'bang 0.60.0 111 Sunday, January 10, 2021 Approved
j'bang 0.59.0 131 Friday, January 8, 2021 Approved
j'bang 0.58.0 108 Sunday, January 3, 2021 Approved
j'bang 0.57.0 107 Monday, December 28, 2020 Approved
j'bang 0.56.0 129 Sunday, December 6, 2020 Approved
j'bang 0.55.2 100 Tuesday, December 1, 2020 Approved
j'bang 0.55.1 123 Thursday, November 26, 2020 Approved
j'bang 0.55.0 110 Thursday, November 26, 2020 Approved
j'bang 0.54.1 85 Tuesday, November 24, 2020 Approved
j'bang 0.54.0 102 Sunday, November 22, 2020 Approved
j'bang 0.53.2 130 Monday, November 9, 2020 Approved
j'bang 0.53.1 105 Sunday, November 8, 2020 Approved
j'bang 0.53.0 104 Saturday, November 7, 2020 Approved
j'bang 0.52.1 112 Monday, October 26, 2020 Approved
j'bang 0.52.0 129 Thursday, October 15, 2020 Approved
j'bang 0.51.1 110 Monday, October 12, 2020 Approved
j'bang 0.51.0 120 Saturday, October 10, 2020 Approved
j'bang 0.50.1 106 Friday, October 9, 2020 Approved
j'bang 0.50.0 114 Thursday, October 8, 2020 Approved
j'bang 0.49.0 92 Tuesday, October 6, 2020 Approved
j'bang 0.48.0 134 Thursday, September 24, 2020 Approved
j'bang 0.47.1 136 Monday, September 21, 2020 Approved
j'bang 0.47.0 100 Monday, September 21, 2020 Approved
j'bang 0.46.1 104 Sunday, September 20, 2020 Approved
j'bang 0.46.0 98 Sunday, September 20, 2020 Approved
j'bang 0.45.0 126 Friday, September 11, 2020 Approved
j'bang 0.44.2 108 Tuesday, September 8, 2020 Approved
j'bang 0.44.0 102 Tuesday, September 8, 2020 Approved
j'bang 0.43.0 126 Wednesday, September 2, 2020 Approved
j'bang 0.42.1 111 Wednesday, September 2, 2020 Approved
j'bang 0.42.0 124 Sunday, August 30, 2020 Approved
j'bang 0.41.0 116 Sunday, August 30, 2020 Approved
j'bang 0.40.1 117 Thursday, August 27, 2020 Approved
j'bang 0.40.0 111 Thursday, August 27, 2020 Approved
j'bang 0.39.0 124 Sunday, August 23, 2020 Approved
j'bang 0.38.0 141 Tuesday, August 18, 2020 Approved
j'bang 0.37.0 122 Monday, August 17, 2020 Approved
j'bang 0.36.1 140 Sunday, August 2, 2020 Approved
j'bang 0.36.0 106 Saturday, August 1, 2020 Approved
j'bang 0.35.1 113 Friday, July 31, 2020 Approved
j'bang 0.35.0 111 Friday, July 31, 2020 Approved
j'bang 0.34.1 105 Tuesday, July 28, 2020 Approved
j'bang 0.34.0 132 Sunday, July 26, 2020 Approved
j'bang 0.33.0 132 Tuesday, July 7, 2020 Approved
j'bang 0.32.0 143 Saturday, June 20, 2020 Approved
j'bang 0.31.0 118 Sunday, June 14, 2020 Approved
j'bang 0.30.0 121 Friday, June 12, 2020 Approved
j'bang 0.29.1 115 Saturday, June 6, 2020 Approved
j'bang 0.29.0 122 Saturday, June 6, 2020 Approved
j'bang 0.28.0 107 Thursday, June 4, 2020 Approved
j'bang 0.27.0 135 Monday, June 1, 2020 Approved
j'bang 0.26.0 125 Sunday, May 31, 2020 Approved
j'bang 0.25.0 111 Thursday, May 28, 2020 Approved
j'bang 0.24.0 114 Thursday, May 21, 2020 Approved
j'bang 0.23.0 113 Saturday, May 16, 2020 Approved
j'bang 0.22.0.2 155 Thursday, April 16, 2020 Approved
j'bang 0.21.0 130 Friday, April 10, 2020 Approved
j'bang 0.20.0 158 Sunday, March 22, 2020 Approved
j'bang 0.19.0 160 Thursday, March 5, 2020 Approved
j'bang 0.18.0 131 Saturday, February 29, 2020 Approved
j'bang 0.17.0 142 Monday, February 24, 2020 Approved
j'bang 0.16.2 158 Saturday, February 22, 2020 Approved
j'bang 0.16.1 138 Sunday, February 16, 2020 Approved
j'bang 0.16.0 148 Saturday, February 15, 2020 Approved
j'bang 0.15.1 151 Saturday, February 15, 2020 Approved
j'bang 0.15.0 110 Thursday, February 13, 2020 Approved
j'bang 0.14.2 162 Sunday, February 9, 2020 Approved
j'bang 0.14.1 131 Saturday, February 8, 2020 Approved
j'bang 0.14.0 152 Tuesday, February 4, 2020 Approved
j'bang 0.13.2 126 Wednesday, January 29, 2020 Approved
j'bang 0.13.1 134 Wednesday, January 29, 2020 Approved
j'bang 0.13.0 180 Wednesday, January 29, 2020 Approved
jbang 0.12.2 108 Saturday, January 25, 2020 Approved
jbang 0.12.1 132 Saturday, January 25, 2020 Approved
jbang 0.11.1 106 Wednesday, January 22, 2020 Approved
jbang 0.11.0 113 Wednesday, January 22, 2020 Approved
jbang 0.6.0.5 123 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