github jbangdev/jbang v0.108.0

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

Changelog

Recently support for main methods without a surrounding class was merged into OpenJDK main line.
This release now supports that feature.

At time of writing the default Termurin JDK builds does not have the latest build thus
for now you will have to manually build the JDK and set that up in your path.

Also since it is a Java preview feature you will need to use --enable-preview or put //PREVIEW in the file.

That means the smallest self-contained Java 21 example looks as follows:

//PREVIEW
//JAVA 21+

void main() {
    System.out.println("Hello World");
}

And can now be run using jbang main.java if you have Java 21 latest nightly build installed.

If you prefer

πŸš€ Features

  • 9c2255b feat: JEP 445: Unnamed Classes and Instance Main Methods (#1633)

πŸ› Fixes

  • ac432ec fix: detect version from JAVA_RUNTIME_VERSION and don't use JAVA_VERS… (#1632)

  • 62d3d7b [minor] java 21 JEP445 support

Contributors

We'd like to thank the following people for their contributions:
GitHub, Max Rydahl Andersen

Don't miss a new jbang release

NewReleases is sending notifications on new releases.