jbang

Unleash the power of Java - JBang Lets Students, Educators and Professional Developers create, edit and run self-contained source-only Java programs with unprecedented ease.

MIT License

Stars
1.3K
Committers
91

Bot releases are visible (Hide)

jbang - v0.50.0

Published by github-actions[bot] about 4 years ago

News

One great feature: "Zero" Install run of jbang scripts.

Linux/OSX/Windows Bash:
curl -Ls https://sh.jbang.dev | bash -s - <args>

Windows Powershell:
iex "& { $(iwr https://ps.jbang.dev) } <args>"

This will install jbang (and java if needed) in local ~/.jbang folder and let you run jbang from anywhere.

Features

  • Now able to use Jbang while only having the script itself (#1e5ae220, closes #219)
  • Added PowerShell script with zero install (#8c26d75e)

Bug Fixes

  • temporary dir now properly set in jbang.ps1 (#47d6d9d1)
jbang - v0.49.0

Published by github-actions[bot] about 4 years ago

0.49.0 (2020/10/06)

First, thanks to @rsvoboda for adding ansi coloring to alias lists!

Second, Agents are coming!

jbang now lets you write and run with javaagents.

Create an agent: jbang init -t agent myagent.java

Use the agent: jbang --javaagent=myagent.java yourapp.java

This of course also works with jbang alises, http & maven artifact support; thus you can do
the following to run your app with the Byteman agent:

jbang --javaagent=org.jboss.byteman:byteman:4.0.13=script:test.btm yourapp.java

Means you can prototype and test and agent very easily, but also distribute it easily by just
make it available via http or as maven artifact.

Note: for now the agents can not have 3rd party dependencies. Will come in future update.

Bug Fixes

  • jbang alias now again works with GAV refs (#41d3cf3e, closes #375)

Features

  • add ansi coloring to alias list (#1e761622)
  • support writing and using java agents (#9cb7d66c)

Refactor

  • minor code simplifications
jbang - v0.48.0

Published by github-actions[bot] about 4 years ago

0.48.0 (2020/09/25)

New features

  • Added --quiet option that will silence any build info and default messages for those who want the cleanest output.
  • edit now works with shells and OS shortcuts, i.e. code now will work on windows where before you had to use code.cmd, Thus i.e. jbang edit --open=code xyz.java works the same on all main platforms.
  • You can now run jdk java-env to get environment pointing to cached JDK by jbang.
  • Improved jdk list command by first time code abd docs contributor @abelsromero
  • There is now both a versioned and unversioned zip/tar - same contents but allows to have a stable latest release download url (https://github.com/jbangdev/jbang/releases/latest/download/jbang.zip)

Details

Bug Fixes

  • //usr/bin/env jbang not working on Windows (#526d70c3, closes #341)
  • Improved --quiet option (#8e7bf13c)
  • os.detected.jfxname now properly resolved (#dea58992, closes #353)

Features

  • Added --quiet option (#802e7543)
  • edit now uses cmd.exe / sh -c to launch editor (#09790789)
  • Added jdk default, jdk home and jdk java-env commands (#aabc9077)
  • improves jdk command output messages (#868b7397, closes #347)

Refactor

  • Turned sym/hard link creation code into utility function
  • Now using special exit code to allow printing to stdout
jbang - v0.47.1

Published by github-actions[bot] about 4 years ago

0.47.1 (2020/09/21)

Bug Fixes

  • sdkman: broadcast api changed. [patch] (#c7148078)
jbang - v0.47.0

Published by github-actions[bot] about 4 years ago

Main new feature is that multiple source //SOURCES now work for http/https hosted scripts too.

We added a JBANG_DEFAULT_JAVA_VERSION env variable you can use in the cases where you don't want jbang to download java 11 to just realize your script has a //JAVA 14+ in it.

And then the very important feature of fixing it so you can run Quarkus in a tweet:

 jbang https://twitter.com/maxandersen/status/1307832761164664834

Bug Fixes

  • twitter: recognize public class as .java even if no main (#88f8ba9c)
  • jdk uninstall now firsts checks if JDK exists (#330) (#31445dc1)
  • made downloading more robust (#329) (#ee3bc241)
  • Fixed requesting open-ended Java versions (#28eb2e8f)
  • made downloading more robust (#329) (#150e8247)

Features

  • Added JBANG_DEFAULT_JAVA_VERSION (#ce85c774)
  • add support for multiple source files via https (#b41dfd22, closes #328)
jbang - v0.46.1

Published by github-actions[bot] about 4 years ago

0.46.1 (2020/09/20)

Quick fix (thanks to @grumpyf0x48) so //SOURCES work when called from outside the directory it is in.

Bug Fixes

  • resolve sources properly based on script location (#327647a9, closes #325)
jbang - v0.46.0

Published by github-actions[bot] about 4 years ago

0.46.0 (2020/09/20)

Multiple source files are here! or at least an initial version.

Multiple source files

You can now in the main script file add //SOURCES File1.java File2.java to have File1.java and File2.java added to the sources being compiled. Note: this is experimental for now, see known limitations further down.

Limits of Multiple source files

This initial support for multiple files has some limitations that depedent on feedback will be lifted.

  1. Main limitation is that all //DEPS and similar commands have to be in the main source file, the additonal source files does not affect the 'build'.
  2. jbang edit probably have limits; right now probably will only work with all files in the same directory.
  3. remote scripts (i.e. over https) does not support multiple source files yet.

Do please try it out and let us know if it works and do please open issues and/or leave comments on the limits above - it encourages on fixing them and helps understand how it is used!

Local alias catalog

The alias commands now will honor jbang-catalog.json files found in current and parent directories all the way to the root. This lets you have jbang aliases defined for your local project and also lets you edit jbang-catalog repositories using just jbang commands. i.e. here is how to setup your own jbang-catalog:

$ mkdir jbang-catalog
$ cd jbang-catalog
$ jbang init hello.java
$ jbang alias add -f jbang-catalog.json hey hello.java

Now jbang hey will run hello.java and you can use git init and push jbang-catalog to your favorite username or org on github, gitlab and gitbucket and jbang hey@yourname will now be possible to run your hello.java as long as they have jbang installed.

A Maven plugin!

@gastaldi contributed a Maven plugin allowing you to more easily use jbang from a maven build.

See more at https://github.com/jbangdev/jbang-maven-plugin.

jbang edit --open and breaking --live

jbang edit now supports using --open=<editor> no matter if you want to have live edit or not.

This unfortunately meant we had to break --live behavior. --live is now a boolean toggle and thus where you previously did jbang edit --live=<editor> you now do jbang edit --open=code --live.

Smarter Quarkus

The mechanism which allows using Quarkus now automatically generates main methods when needed and sets up needed java flags (such as logmanager) making the script files even smaller. Note: requires Quarkus 1.8.1+.

Commits

Bug Fixes

  • "javac not found" error (#298) (#81126a3d, closes #283)
  • Add missing backtick in catalog table (#315) (#13a84983)
  • templates: escape path to not trigger qute (#2cfe03cb, closes #317)

Features

  • Add ability for integration classes to return JVM args and main classes (#320) (#f1b02490)
  • Support for local/nearest catalogs (#722e9333, closes #180)
  • save persistent args in jar for reuse (#5bde293e)
  • Initial support for multiple sources (#323) (#fdf97ffe)
  • edit: add `--open=[editor] and make --live a boolean (#314) (#9e872630)

Breaking Changes

  • edit: due to 9e872630,
    --live=[editor] will no longer work. Use --open=[editor] --live instead.
jbang - v0.45.0

Published by github-actions[bot] about 4 years ago

News

New features:

  • jbang wrapper install to install/setup jbang to run from local directory akin to maven and gradle wrappers for committing into your project. Thanks to @quintesse
  • Add some example init templates for Quarkus: qrest, qcli and qmetrics
  • jbang-action now also published to github container registry under: git pull ghcr.io/jbangdev/jbang-action

Bug fixes:

  • --live=<editor> now works better with using spaces in the argument. Thanks to @zakkak
jbang - v0.44.2

Published by github-actions[bot] about 4 years ago

News

Dumb bugfix: sdkman release script was generating bad links. now hopefully fixed - thanks @bmuskalla

jbang - v0.44.0

Published by github-actions[bot] about 4 years ago

News

Behaviour change:

  • previous versions had dependency classpath first, user classes last.
    Now its user classes first, dependency classes last so jbang or its SPI
    can ensure their classes gets picked up first. The old behavior caused
    problems with Quarkus as it modifies certain classes for optimized start
    and these were not picked up. Should not cause any bad issues; except if
    you relied on your classes to be ignored :0)

Bugfix:

  • Cleaned up docs! thanks to @abelsromero
jbang - v0.43.0

Published by github-actions[bot] about 4 years ago

News

New feature: //FILES now work on scripts fetched from absolute urls (i.e. not swizzled ursl like gist, twitter, etc. that will come later).

Makes it possible to do: jbang https://gist.githubusercontent.com/maxandersen/310cf9d404a7ed68e5ff04aed0fa7f92/raw/cff889b205ef7ca36a51cf0792b73b6df17b75d5/quarkus.java which is backed by this https://gist.github.com/maxandersen/310cf9d404a7ed68e5ff04aed0fa7f92

jbang - v0.42.1

Published by github-actions[bot] about 4 years ago

News

Bug fix:

  • java flight recorder now using proper extension .jfr rather than .jfc so visualvm and jdk mission control actually will load them.
jbang - v0.42.0

Published by github-actions[bot] about 4 years ago

News

Changed behaviour:

  • Recent //FILES from=to changed to //FILES to=from which is deemed the better way. Sorry for noise - those of you who relied on this behaviour for the last 3 hour please just flip the arguments and you will be fine :)
jbang - v0.41.0

Published by github-actions[bot] about 4 years ago

News

New features:

  • You can now use --class-path <file> and --deps <gav> to add additional jars to your script. Useful for use with serviceloaders for dynamic class and/or resource loading.
  • Early support for //FILES <path>[=<destination>] to allow adding resources to the project. i.e. //FILES META-INF/application.properties index.html=META-INF/resources/index.html Results in META-INF/application.properties and a `META-INF/resources/index.html' in the classpath/jar.

Be aware //FILES does not work with jbang edit and http based scripts. Will come later.

jbang - v0.40.2

Published by github-actions[bot] about 4 years ago

News

  • Fix: maven repositories passed into the experimental SPI
jbang - v0.40.1

Published by github-actions[bot] about 4 years ago

News

Bug fix:

  • code jbang edit hello.java` broke; writing to stderr instead stdout. Now fixed.
jbang - v0.40.0

Published by github-actions[bot] about 4 years ago

News

This is a fairly technical internal release; but it does enable some exciting features for the future: integration of build time frameworks like Quarkus.

New Feature:

  • Added SPI with help from @stuartwdouglas to allow user dependencies to participate in jbang build which allows us to create and use jbang to make full-blown Quarkus apps with native image support etc. Requires https://github.com/quarkusio/quarkus/pull/11542 in Quarkus to work.

Behaviour changes:

  • dependency cache now store Group/artifact/version together with file version in a .json file instead of .txt.
jbang - v0.39.0

Published by github-actions[bot] about 4 years ago

News

Behavioural change:

  • Docker no longer uses USER in github action to work best but now not work in OpenShift out-of-box.

Bug fixes:

  • Space bug came back again on Windows; hopefully fixed for good!
  • gist urls now have default trust include author name (i.e. https://gist.github.com/maxandersen instead of https://gist.github.com)

Other:

  • Document use of Signal to do chained pipes with jbang scripts.
jbang - v0.38.0

Published by github-actions[bot] about 4 years ago

News

Bug fix/Change in behaviour: Thanks to patience of @gastaldi we tracked down a bug in the parameter passing for the JBang github action. Fix required to change to use scriptargs instead of args when specifying arguments.

jbang - v0.37.0

Published by github-actions[bot] about 4 years ago

News

  • New feature: Easy enablement of Java Flight Recorder using jbang --jfr myapp.java. Will enable flight recording and save it to myapp.jfr which you then can open in Java Mission Control or jvisualvm.
Package Rankings
Top 6.73% on Proxy.golang.org