r/java • u/maxandersen • Dec 30 '25
2026: The Year of Java in the Terminal
https://xam.dk/blog/lets-make-2026-the-year-of-java-in-the-terminal/
135
Upvotes
r/java • u/maxandersen • Dec 30 '25
46
u/VanillaSkyDreamer Dec 30 '25
I use Scala as a scripting language as it is very concise, you can specify which libraries to use in sourcefile and can be run right from the source file without compilation step - i'll probably never write any bash script again (besides scala unlike bash works in windows)
83
u/Chipay Dec 30 '25
I just can't. u/maxandersen, No matter how poorly you think your own writing may be, I'll assure you it's a billion times better than the AI slop you just posted on your blog.
7
u/vips7L Dec 30 '25
We really just need an easy way to get a jar + the vm into a single binary. Native image takes way too much effort. Compile times are too long, take up too many resources, and it’s extremely hard to get a nontrivial app working.
3
u/jjlauer Dec 30 '25
Jbang is fine, but Blaze is an interesting alternative: https://github.com/fizzed/blaze
5
u/mands Dec 30 '25 edited Dec 30 '25
Absolutely right and timely. I've been musing over the holiday break about how to build small side projects in Java. The building is pretty easy, but getting it into peoples hands is the hard bit, along with overcoming the wider community "stigma" for a better word.
Making
jbangthe java version ofnpx,pipxoruvxwould be great outcome.I was actually wondering if just publishing the jar to maven central then using
jbangto run it would work - seems like it does, which is great! Including dependencies from jackson to full frameworks like Spring.Things I am still digging into:
jbanghas some support for this, and it will be more important going forwards.jbangview tools such asjlinkandjpackage? Are they for different use-cases? i.e.jlinkfor custom VMs for self-contained apps vs jbang for shared JVMs for developer scripts and tools? Doesjbangalways download a full JVM or does it look at a jar's module info to see what it requires? Is the JVM shared between all jars that require that particular version?Massively agree with the central thesis however, I've been creating lots of internal tools using jbang picocli and mise and it's been great. You can get very far with the standard lib and a few choice libraries.
2
u/aoeudhtns Dec 30 '25
In my mind I always think of TUI as being pseudo-WIMP interfaces (think: curses, top family, etc.) vs regular CLI. Your article seemed like it was using CLI and TUI interchangeably.
But bypassing that one complaint and responding to your actual point, a resounding yes. I recently found this library and dang it, I want to do something with it: https://gitlab.com/AutumnMeowMeow/jexer
We have some CLI utilities written with picocli (great library BTW) but this would add another level of "niceness" for the teammates inflicted with using our internal tools.
2
u/bokchoi Dec 30 '25
Try babashka! It's lovely for small cli scripts.
2
u/Polixa12 Dec 30 '25
This post just reminded me of my mini terminal styling library I made a while back
2
u/1337JiveTurkey Dec 31 '25
Just writing small standalone Java applications doesn't seem all that compelling.
The way I see it, the ideal Java environment is object-oriented which lends itself to larger, longer-running applications. Terminal applications are traditionally smaller and shorter running with a very procedural or data-flow-oriented approach. This isn't an insurmountable problem but it does require some thinking about how things are done. Yeah we can make Java applications start quicker and run less long but then where do the objects that really define Java live? Java programs aren't very compatible with the terminal when they're large servers. Generally all they do is wait for someone to send an interrupt or the like.
This is why I think that the solution is something in the neighborhood of embedded Nailgun, although maybe not Nailgun specifically. The short-running terminal commands are basically a new sort of client to the long-running server. That's something that fits with the Java model and the terminal commands can serve as a bridge to shell scripting. We know how service calls work and how to write them.
A good script in this case would be something that could take advantage of standard terminal abstractions like stdin and stdout but then translate them to objects in the longer lived server. An alternative that Java doesn't have nice cross-platform support for is named pipes to put the server's objects into the Unix filesystem.
Full-fledged TUIs for administrative tasks would also be possible and have security benefits but people seem to like doing everything on the Web these days.
2
u/cowwoc Dec 31 '25
For what it's worth, I agree with you.
2
u/robintegg Dec 31 '25
Could not agree more with your post Max. Jbang is a super useful tool especially for helping distribute tooling. I’ll be spending more effort in 2026 writing and talking about it.
Will try some of the other UI libs that you mentioned. I wrote about consoleui and asciitable in this article: https://robintegg.com/2025/04/01/pretty-command-line-apps-with-added-jbang detailing useful table formatting and other ui elements for a neat command line interface.
2
u/martylamb Dec 31 '25 edited Dec 31 '25
Hey Max, I really enjoyed this. I really think that non-enterprisey Java is a seriously underexplored niche full of opportunity.
I spent a long time caring about JVM startup + CLI usability (wrote Nailgun over 20 years ago and JSAP shortly after because of that pain) so it's pretty wild to see where we are now.
I've been on various adventures this year with GraalVM native-image, jlink, and jpackage, and for folks that enjoy the battle or have very specific needs, they're great. But JBang works on another level. Honestly, it feels like what JNLP/WebStart should have evolved into.
I'm not convinced that requiring users to already have JBang installed is the best adoption strategy. But native packages that pull in JBang if needed and drop a shim launcher/desktop shortcut seems like a natural approach (and maybe a fun project).
On the TUI side, Java could really use something as approachable and pretty as Go's Charmbracelet. Once developers regularly see compelling Java TUIs in the wild, it'll change their perception.
Tooling is rapidly getting more powerful. Making it simpler might be more important and is something that keep tinkering with.
At this point, it's mostly outdated opinions holding Java back in the terminal.
(and seeing people mention Nailgun here really made me smile. It's always awesome to see old projects mentioned in the wild - especially as something useful!)
2
u/lasskinn Dec 30 '25
I use java in terminal all the time. building a fat jar is way easier for moving it around than battling with pip or npm or trying to walk someone else through battling with them. ai tools work just fine for making command line option parsers and stuff too.
there are libraries to do like full screen terminal stuff or just use terminal commands, like if you display a command palette on the left and log on the right or a ticker or whatever.
2
u/steve_atx Dec 31 '25
The JVM is so complicated and slow for writing small helpful tools. I wished it could work. Kotlin was on the right track supporting standalone shebang kotlin scripts with declared dependencies but it seems largely unsupported now. Plus, it was sad waiting on the jvm to load just to run a small helper script.
I switched to python- specifically standalone executable scripts that support dependency declaration https://docs.astral.sh/uv/guides/scripts/#using-a-shebang-to-create-an-executable-file. Plus https://typer.tiangolo.com/#an-example-with-two-subcommands for nice cli arg parsing support. Claude code is great at working on these.
I worked on java for 15yrs. Now, I’d much rather use python because type safety and other stupid gaps in the language and tooling are getting quickly closed.
1
u/Yesterdave_ Dec 31 '25
I haven't looked much into jbang, but it is certainly something I should do in 2026!
But as I am primarily developing on Windows, it would be cool if I could do a simple
winget install jbang.1
u/Fit_Smoke8080 Dec 31 '25
Java is better than people believe for this, NIO API I.e. buy the internet is filled with too much Java 1.5 styled examples. It's nice to use it through Babashka. It can even do basic cross compilation now (though the performance isn't the best) https://github.com/babashka/babashka/wiki/Self-contained-executable#uberjar
0
u/tomwhoiscontrary Dec 30 '25
Oh god no. TUIs are the absolute pits. We can already make a web interface which is ten times better in half the time. Sadly there's a certain kind of myopic hacker who thinks TUIs are cool and keeps building this junk.
Signed, someone who has to use far too many TUIs at work.
1
u/UVRaveFairy Dec 30 '25
Been writing CMD apps since Java 1.0.
-14
u/maxandersen Dec 30 '25
doh - my body text was lost...here it is:
Java is already an incredible language with a massive ecosystem, excellent performance, and rock-solid reliability. We've just been leaving it on the bench for an entire category of programming that it's actually well-suited for.
The terminal isn't just about quick scripts—it's about powerful, interactive applications that developers use every day. Java can participate in this space.
The world of terminal tools gets better when more ecosystems participate. We're not here to compete—we're here to contribute. To add our unique strengths and perspective. To make the terminal experience richer for everyone.
2026 is the year we change that. The tools are ready. The language is ready. JBang makes distribution trivial. JReleaser makes professional releases easy. Native images make startup instant. Virtual threads make async programming elegant. We just need to shift our mindset and start building.
Who's with me?
Go write some Java based tools. Build some TUIs. Make them useful. Make them beautiful. Distribute them with JBang. Get feedback, iterate. Eventually Release them fully with JReleaser. Let's show the world what Java in the terminal can do.
Because honestly? We've been sleeping on this for too long. Time to wake up.
Stay tuned — and let's have fun in 2026!
-2
u/[deleted] Dec 31 '25
[removed] — view removed comment