github jbangdev/jbang v0.34.0

latest releases: v0.132.1, v0.132.0, v0.131.0...
5 years ago

News

This changes (almost) everything!

No Java ? No problem!

With great help from @quintesse jbang will now download Java 11 if no java is available; making it possible to run java scripts on any machine without any setup. This is huge! Basically no easier way to get started using Java than via jbang (if you know of something easier I would love to hear what we can improve :)

//JAVA <version> for auto-download of matching Java runtimes from AdoptOpenJDK

Previously you had to always have the right version of java installed to run your jbang script - you can still do it but we find it quite tedious!

Now you can specify in a script using //JAVA 11+ to indicate you want to run with a JDK version 11 or higher. If one is available jbang will use it; but if not it will download the right adoptopenjdk JDK for your platform!

You can specify any kind of major java version as long as it is available from AdoptOpenJDK!

Aliases

You can now use jbang alias to add, remove and list aliases to allow you to hide full path / url details of the script. Nice for you own scripts.

Implicit Script Catalogs

jbang is all about making it easy to run Java based scripts; with JDK auto download and aliases it opens up for an interesting feature: implicit script catalogs.

Seeing is believing, thus install jbang 0.34 and run this: jbang properties@jbangdev

This will run a script provided at https://github.com/jbangdev/jbang-catalog.

You can see which are available using jbang alias list jbangdev.

And of course you can provide this too on Github, GitLab and BitBucket; jbang will automatically look for jbang-catalog in your org/username.

If you want to call it something else then you can be explicit: jbang properties@maxandersen/weird-catalog.

Running Jar directly or via GAV's

Over time we noticed that we were writing jbang scripts that was just a wrapper of something available in Maven.
To skip having to write dumb wrapper scripts you can now run jars or GAV's like:

local jar:

jbang helloworld.jar

GAV:

jbang info.picocli:picocli-codegen:4.2.0

See more in the docs; but in short - big release that makes jbang and java much more easily available!

Enjoy and give a follow to https://twitter.com/jbangdev

Don't miss a new jbang release

NewReleases is sending notifications on new releases.