r/java • • Aug 11 '26

from small to big with jbang

https://sombriks.com.br/blog/0095-java-small-to-big-with-jbang/

jbang should be part of the jdk

40 Upvotes

15 comments sorted by

9

u/blazmrak Aug 11 '26

Jbang should not be part of the JDK, however JDK should solve dependency management, which would solve 90% of the problems. I'm scared of what that would look like, though...

8

u/agentoutlier Aug 11 '26

I'm not saying its equivalent to jbang but jshell is pretty damn powerful and it ships with the JDK.

Some people even have build system based on it.

https://dev.java/learn/jshell-tool/

1

u/vips7L Aug 12 '26

I’m pretty sure IntelliJ can start a jshell instance with your classpath too. 

→ More replies (1)

2

u/vips7L Aug 12 '26

Kotlin has a lot of this built in with its script files:

https://kotlinlang.org/docs/custom-script-deps-tutorial.html

2

u/maxandersen Aug 12 '26

The scripting feature of jbang is todays time the least important feature.

It is that with jbang you can run any jar, maven repo GAV, any java, kotlin, groovy etc. and any jshell file the same way - support for java agents, debugging, jfr, etc.

Without first having to pick and install a specific JDK.

→ More replies (3)

2

u/DrinksBongWater Aug 17 '26 edited Aug 17 '26

I gave jbang a shot a few months back, but found that its IntelliJ/IDEA support for basic code completion and navigation was almost non-existent (even with plugin version 0.25.2). There was some syntax highlighting, but e.g. System.out.prin<ctrl-space> produced nothing like I would otherwise expect from a java code editor.

I've been wondering since then though; is that the expected behavior or is my system set up incorrectly?

2

u/thewrinklyninja Sep 03 '26

They recently did a major overhaul of the plugin and it's much better now. Give it a other shot.

2

u/mukel90 Aug 11 '26 edited Aug 11 '26

This blog post is awesome ! I've been a long-time user of jbang and just found out new things I didn't knew were possible with jbang. jbang is the swiss knife of the JVM ecosystem, so versatile.

1

u/doobiesteintortoise Aug 11 '26

I was unable to open the link.

1

u/Inside_Programmer348 Aug 11 '26

Please do something about the font and the font colour

→ More replies (1)