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
Bot releases are visible (Hide)
Published by github-actions[bot] about 4 years ago
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.
Published by github-actions[bot] about 4 years ago
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.
Published by github-actions[bot] about 4 years ago
--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.jdk java-env
to get environment pointing to cached JDK by jbang.//usr/bin/env jbang
not working on Windows (#526d70c3, closes #341)--quiet
option (#8e7bf13c)--quiet
option (#802e7543)jdk default
, jdk home
and jdk java-env
commands (#aabc9077)Published by github-actions[bot] about 4 years ago
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
jdk uninstall
now firsts checks if JDK exists (#330) (#31445dc1)JBANG_DEFAULT_JAVA_VERSION
(#ce85c774)Published by github-actions[bot] about 4 years ago
Quick fix (thanks to @grumpyf0x48) so //SOURCES
work when called from outside the directory it is in.
Published by github-actions[bot] about 4 years ago
Multiple source files are here! or at least an initial version.
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.
This initial support for multiple files has some limitations that depedent on feedback will be lifted.
//DEPS
and similar commands have to be in the main source file, the additonal source files does not affect the 'build'.jbang edit
probably have limits; right now probably will only work with all files in the same directory.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!
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.
@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
.
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+.
--open=[editor] --live
instead.Published by github-actions[bot] about 4 years ago
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 @quintesseqrest
, 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 @zakkakPublished by github-actions[bot] about 4 years ago
Dumb bugfix: sdkman release script was generating bad links. now hopefully fixed - thanks @bmuskalla
Published by github-actions[bot] about 4 years ago
Behaviour change:
Bugfix:
Published by github-actions[bot] about 4 years ago
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
Published by github-actions[bot] about 4 years ago
Bug fix:
.jfr
rather than .jfc
so visualvm and jdk mission control actually will load them.Published by github-actions[bot] about 4 years ago
Changed behaviour:
//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 :)Published by github-actions[bot] about 4 years ago
New features:
--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.//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.
Published by github-actions[bot] about 4 years ago
Published by github-actions[bot] about 4 years ago
Bug fix:
code
jbang edit hello.java` broke; writing to stderr instead stdout. Now fixed.Published by github-actions[bot] about 4 years ago
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:
Behaviour changes:
Published by github-actions[bot] about 4 years ago
Behavioural change:
Bug fixes:
https://gist.github.com/maxandersen
instead of https://gist.github.com
)Other:
Signal
to do chained pipes with jbang scripts.Published by github-actions[bot] about 4 years ago
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.
Published by github-actions[bot] about 4 years ago
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.