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...
Kotlin sure is less awful, for example. But the JVM, as I describe, was always a failed experiment.