logoalt Hacker News

2026: The Year of Java in the Terminal?

77 pointsby based2today at 3:55 PM110 commentsview on HN

Comments

martylambtoday at 6:18 PM

I spent a long time caring about JVM startup time and CLI suitability (and wrote nailgun [0] over 20 years ago and jsap [1] shortly after specifically because of it), so it's pretty wild to see how far things have come. Modern JVM startup speed and GraalVM native-image have eliminated most of the old excuses. jlink+jpackage help a lot with distribution, and JBang takes it to another level. I've used JBang before but still learned some new tricks from this post. 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 a native package that pulls in JBang if needed and drops 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 [2]. Once developers regularly see compelling java TUIs in the wild, it'll change their perception.

The tooling is here, or at least really close. At this point, it's mostly outdated opinions holding java back in the terminal.

[0] https://martiansoftware.com/nailgun

[1] https://martiansoftware.com/jsap/

[2] https://github.com/charmbracelet

CamouflagedKiwitoday at 6:39 PM

Why? It's not well suited to it - fundamentally the language semantics lead to very large distributions, slow startup and expecting a runtime on the machine. Okay, I hear this can be solved by Graal, but that's a whole piece of its own complexity that you'd never have to worry about with a tool written in something like Go.

Python has many similar properties, but at least there I can understand that Python is a 'pretty' language to write things in. Java has never been something that I have ever wanted to choose, and far, far less so when there's a big hill to climb like this.

I guess I fundamentally disagree with all the statements in the article like "This needs to change". I don't think it does. I would much rather than people wrote CLIs in Go or Rust than Java, 100% of the time the latter has been more painful for me to consume.

show 2 replies
vips7Ltoday at 4:52 PM

Java will never become a player in CLI tooling until build packaging becomes first class. Go, Rust, and other languages are so common because their build tooling is dead simple. You can easily get a single file distributable in a single command. go build, cargo build, dotnet publish —-self-contained.

Java on the other hand makes it impossible to get a single distributable. There is no way to get your jar + the vm into a binary. You could use graal native image, but build times are super slow, use too many resources, and it’s non-trivial to get working.

Build tooling in the Java ecosystem just isn’t good enough.

show 10 replies
newsofthedaytoday at 7:10 PM

You can do this in Java 21, create this small Java file and run it immediately:

    class HelloWorld {
        public static void main(String[] args) {
            System.out.println("Hello, World!"); 
        }
    }
    
    java HelloWorld.java
Include the .java extension, you're running the file directly.

time java HelloWorld.java

    Hello, World!

    real    0m0.278s
    user    0m0.613s
    sys     0m0.066s
wcallahantoday at 5:14 PM

It just so happens that I’ve built one already: TUI4J (Terminal User Interface for Java).

https://github.com/WilliamAGH/tui4j

It combines a port of BubbleTea from Go, and Textual and other inspired rewrites of other functionality.

It’s a fork of someone’s earlier work that I sought to expand/stabilize.

I built a beautifully simple LLM chat interface with full dialog windows, animations, and full support for keyboard and mouse interactivity parity, showing what this Java library is capable of.

Example chat app: https://github.com/WilliamAGH/brief

Would love to see others build similar things with it!

show 1 reply
ecshafertoday at 4:35 PM

Java startup time shouldn't really be an issue with a terminal program. I have written some pretty complex Java and Rust and C++ terminal programs, they are basically indistinguishable on run time. The reason Java starts up slow for most people is that they are running webapps with Spring and 50 dependencies and loading Tomcat, not because they are just booting a JVM and running through some functions.

Getting AoT compiled Java programs has been a life saver. Running java -jar main.java -foo -bar is very annoying and not friendly. It needs to be packaged so you can just run tool -foo -bar

show 1 reply
gunnarmorlingtoday at 5:09 PM

As a practical example for a Java-based CLI tool in the wild, here's kcctl, a command line client for Kafka Connect: https://github.com/kcctl/kcctl/. It's a native binary (via GraalVM), starting up in a few ms, so that it actually be invoked during tab completions and do a round-trip to the Kafka Connect REST API without any noticeable delay whatsoever.

Installation is via brew, so same experience as for all the other CLI tools you're using. The binary size is on the higher end (52 MB), but I don't think this makes any relevant difference for practical purposes. Build times with GraalVM are still not ideal (though getting better). Cross compilation is another sore point, I'm managing it via platform-specific GitHub Action runners. From a user perspective, non of this matters, I'd bet most users don't know that kcctl is written in Java.

FriendlyMiketoday at 4:48 PM

I've been a Java developer for twenty years. I've used it for everything front front end to distributed systems. I've built gradle plug-ins and clips with JAVA. I have every shortcut in intellij memorized.

Even with all this it takes me substantially less time to get go, python, or ts working as a cli. Java cli is a solution looking for a problem

show 3 replies
larussotoday at 4:45 PM

Maybe some of the old beliefs regarding startup time etc are no longer valid. Maybe the programming model isn’t as verbose as it used to be. But I don’t want to distribute a 200MB+ binary. I have colleagues who tell me that c# scripting is so awesome. One only needs .NET installed or use AOT or whatever. Sorry but Go and Rust and good forgive a python script is smaller and mostly easier to read and write then most stuff I seen other languages shoehorning into. I have nothing against Java but it isn’t the right hammer for this problem. At least for me. And I wish people wouldn’t constantly strive for the single language for every problem mindset. Yes in a Java shop it might make more sense to write cli tools and scripts also in Java. But that doesn’t mean it is the most effective toolchain in the long run.

show 2 replies
waffletowertoday at 4:57 PM

Babashka has been available and has had a growing following since 2019. I have many babashka shebang deployed scripts with fast startup. While I would never desire to use Java syntax, AOT capable JVM based Clojure libraries are available and can be loaded dynamically. Built via graal. https://babashka.org

show 1 reply
laughingcurvetoday at 4:47 PM

The article makes no compelling points to me as an avid user of these applications.

I would rather shove ice picks covered in lemon juice than provide Java or Ellison anymore room in the digital ecosystem. And I’m not talking politics here wrt Ellison, just awful

show 1 reply
thefauxtoday at 4:46 PM

> Try a GraalVM native image. Milliseconds. Gone.

Try building a GraalVM native image. Minutes gone.

show 1 reply
languagehackertoday at 6:07 PM

Will 2026 be the year hammers get a little phillips head on the back in case you run into one of those weird ribbed nails?

nathelltoday at 6:27 PM

Java in the terminal works exquisitely well already, and it’s called Babashka. Clojure rocks, Bash reaches, and Java provides a rock-solid foundation.

f2hextoday at 6:47 PM

Java is legacy... when you started working with Python, Golang, Rust, Typescript, Swift... still need Java??

aoli-altoday at 5:15 PM

My biggest complaint about Java development is the state of LSP/DAP support. I’ve tried writing Java in VS Code, and the support is still very incomplete. There are two features I want the most: (1) automatically downloading source code for dependencies, and (2) pausing all threads when a breakpoint is hit (https://github.com/microsoft/vscode-java-debug/issues/722 ).

I can’t find any editor or IDE that comes close to IntelliJ. If we want Java in the terminal, we may also need to think how to write Java in the terminal or are they orthogonal?

ninth_anttoday at 6:25 PM

I get the argument from this article that it’s possible.

But I don’t get the argument that this is somehow desirable. Just because it’s possible to smash a square peg into a round hole doesn’t make it a good idea.

pregnenolonetoday at 7:13 PM

I'm sorry, but this is a big load of crap and that includes some of the comments in here. Java enthusiasts are the absolute world champions of sugarcoating the shortcomings of Java and the JVM in general.

This is what writing a CLI application in Go looks like: you download Go and immediately have all the tools needed to manage dependencies, write applications, and compile them into lightweight, distributable binaries with a simple command.

Now, let’s consider how this process looks in Java. First, you need to download A(!) JDK – and there are multiple ones. Many newcomers struggle with the variety of JDKs, but let's move past that. The JDK alone doesn’t handle dependencies; it’s highly likely you’ll end up using either Maven or Gradle, both of which are complex and tiresome, requiring you to deal with either XML (Maven) or Groovy/Kotlin. What seems to be missed is the potential of tools like JBang, which should ideally come out of the box. The Scala people addressed this effectively with scala-cli which is now the default Scala runner. Anyway, you’re still far from finished. You've just figured out how to write applications; now you need to figure out how to distribute them. This involves understanding jpackage – if you want an application smaller than 100MB, you’ll likely need to use jlink beforehand. And, heaven forbid, your application uses Java 9+ modules, as then you'll be wrestling with the complexities of modularity itself. If you’ve managed to navigate all of this, you’ll end up with an application that includes a bundled JRE. A compressed, modularized “hello world” application can easily size at least 30MB and take several hundred milliseconds to start.

Then there's Graal Native, which allows you to compile your applications ahead of time into natively executable binaries. However, compiling Java applications ahead of time is complicated by runtime class initialization, reflection etc. which is why the Graal compiler needs significant configuration beforehand. There are tracing agents to help you compile such configurations, but even with them, it’s incredibly tiresome and not always reliable. Furthermore, the produced binaries tend to be large and don't play well with upx.

I think the JDK developers could learn from Scala CLI, which is now the default Scala runner. I'm convinced it would really help Java if it came with something like that out of the box.

bsan3today at 4:39 PM

Agree, Java also had straight single file execution forever now. Java foo.java. I use it instead of scripts all the time. Solid language with a lot of flexibility, Oracle has done a good job in last few years. Newer Java frameworks are fairly easy and light to use. We have natively image Lambda functions in production. Work well.

show 1 reply
thomashabets2today at 6:11 PM

I'm not saying we should phase Java out. But it's pretty clear to me that Java was a bad experiment in almost every aspect, and we should at least not add new use cases for it.

So no. No, please god no, no Java in the terminal.

More ranting here: https://blog.habets.se/2022/08/Java-a-fractal-of-bad-experim...

show 1 reply
bfungtoday at 6:15 PM

Article meta comment: show me, don’t tell me.

No show —> not easy enough —> too lazy to look it up, already got python/go/ruby quick cli methods. LLM generated even easier.

wolfi1today at 6:15 PM

how about jshell? it comes with every java distribution

aziis98today at 4:25 PM

I didn't know about JBang, it looks awesome. Does it work somewhat like uv?

Alifatisktoday at 6:03 PM

I wish the article dug deeper into how the workflow would look like in the practical sense when using jBang and jReleaser.

mellosoulstoday at 6:08 PM

Strangely, not a mention of groovy which I seem to remember was somewhat motivated by use cases such as this?

timcobbtoday at 5:22 PM

2026 is going to be the year of learning languages as you review LLM generated code

nailertoday at 6:39 PM

But latency. No Java app I have used in 25ish years has ever started in a reasonable amount of time.

show 2 replies
reactordevtoday at 4:24 PM

The moment you introduce the jvm, is the moment people flee.

Graal would be needed and then your binaries would be huge.

No thanks. Go is much simpler. Rust is much smaller. Java can go die in the office storage closet.

show 1 reply
RickJWagnertoday at 5:37 PM

Languages lose users when the tooling becomes too heavy.

You have to learn ( and maintain knowledge of ) build tooling, unit test frameworks, tools for front end / back end development, distribution and packaging systems, directory structures to accommodate all those, etc. ad nauseum.

Then something new and shiny comes out, with much smaller tooling. The lure of easy software construction seduces the user.

It never ends.

oncallthrowtoday at 5:09 PM

No, Java (or frankly anything JVM-based) on the terminal is a terrible experience.

TacticalCodertoday at 5:05 PM

I've been writing Java utils for the terminal since forever. Mostly because I was extremely familiar with Java. It's never been really slow unless you were loading shitload of classes, like apps that package the entire kitchen sink do or as Clojure does for example. For Clojure now there's Babashka: super quick.

And GraalVM compiled Java is more than speedy.

Back in, say, 2005, two decades ago, on computers from back then, sure, the java startup time from the CLI were noticeable. But on today's computers?

Nowadays when it comes to terminal apps I wrote both Clojure (Babashka), Bash and Java (recently I needed something from a .jar and had no convenient Clojure wrapper and didn't want to bother, so I just wrote my CLI app in Java).

Maybe, maybe, maybe that I do feel the startup time when I run my CLI Java app on Raspberry Pis. Raspberry Pi 2 and 3s that is (for I don't have any newer).

Startup times aren't an issue. But there may be other reasons to prefer other languages to write CLI apps.

jen20today at 5:00 PM

There are approximately no use cases that would get me to run a CLI written in Java on my machine, especially if it required having a JVM installed. There's just no reason for it.

The rounding error there is Pkl, which is at least built using Graal Native Image, but (IMO) would _still_ have better adoption if it was written in something else.

That said, if the Java community wanted to port reasonable tooling to their platform, I'm sure Claude could do a reasonable job of getting a decent chunk of BubbleTea and friends bootstrapped.

show 2 replies
nickstinematestoday at 4:37 PM

Very clearly written by AI. Java in the terminal sounds awful. Programming Java is awful.

No thank you.

show 2 replies
binarymaxtoday at 6:07 PM

The question mark at the end is an easy out for us to claim Betteridge’s law.

show 1 reply
tgpctoday at 5:48 PM

use rust or go, please

single binary, no complex deps, ftw

whalesaladtoday at 4:21 PM

I would use this instead, https://babashka.org/

show 3 replies
idkanatoday at 6:53 PM

[dead]

sneakinsnaketoday at 4:46 PM

Go?

elzbardicotoday at 5:04 PM

Well, the year is 2003 and I am on a hot dungeon with bad Air Conditioning, figuring out the correct spells for a black magic ant build. A few years later I am writing tons of XML, first for vanilla J2EE, then for spring. We complained, we wondered, nobody cared until one day we decided "fuck that shit, I don't care if ruby is slow as molasses, I just want the pain to go away!"

Forgive me if in 2026 I get triggered at the mere mention of the phrase "java build".

Lots of us had long relationships with Java, relationships marked by toxicity and abuse. We moved on. Now Java says it is changed, it has matured. Well, it could be true, probably it is even true, but on the other hand, now your toxic ex found out his father, and his name is Larry Ellison.

WD-42today at 5:00 PM

Looking forward to implementing a AbstractCommandlineParserFactoryBeanServicePatternFactory

show 1 reply