Skip to content

Tags: alblue/jbang

Tags

v0.50.1

Toggle v0.50.1's commit message
<a name="0.50.1"></a>

Just a bugfix release, mainly fixing a issue in zero install for powershell and
adding javaagent dependencies to boot-class-path so you can use 3rd party tools in your agent (like javassist).

* We now properly notify Jbang we're running in PowerShell (#bf629dbd, closes jbangdev#401)
* fix outdate docs about --live=idea that is not --live --open=idea  (#2442beaf, closes jbangdev#405)
* add DEPS for JAVAAGENT to boot-class-path in manifest.mf (#d13fde27)

* Jbang zero-install is now located in `~/.jbang/bin` [patch]

v0.50.0

Toggle v0.50.0's commit message
<a name="0.50.0"></a>

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.

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

* temporary dir now properly set in jbang.ps1 (#47d6d9d1)

v0.49.0

Toggle v0.49.0's commit message
<a name="0.49.0"></a>

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.

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

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

* minor code simplifications

v0.48.0

Toggle v0.48.0's commit message
<a name="0.48.0"></a>

* 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

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

* 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 jbangdev#347)

* Turned sym/hard link creation code into utility function
* Now using special exit code to allow printing to stdout

v0.47.1

Toggle v0.47.1's commit message
<a name="0.47.1"></a>

* **sdkman:** broadcast api changed. [patch] (#c7148078)

v0.47.0

Toggle v0.47.0's commit message
<a name="0.47.0"></a>

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:

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

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

* Added `JBANG_DEFAULT_JAVA_VERSION` (#ce85c774)
* add support for multiple source files via https (#b41dfd22, closes jbangdev#328)

v0.46.1

Toggle v0.46.1's commit message
<a name="0.46.1"></a>

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

* resolve sources properly based on script location (#327647a9, closes jbangdev#325)

v0.46.0

Toggle v0.46.0's commit message
<a name="0.46.0"></a>

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.
  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!

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`:

```shell
$ 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` 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+.

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

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

* **edit:** due to [9e87263](/commits/9e8726304878b7a66258817002e6a63ba6731519),
  --live=[editor] will no longer work. Use `--open=[editor] --live` instead.

v0.45.0

Toggle v0.45.0's commit message

v0.44.2

Toggle v0.44.2's commit message