Why is java -version implemented in Java?

Thomas Stüfe thomas.stuefe at gmail.com
Mon Nov 23 12:59:34 UTC 2020


>
>
>
> One thought I have, and I don't know if that is good or bad, is that the
> new, GNU-style long-option java --version that was introduced not too
> long ago is not as likely to have this legacy of expecting VM startup.
> It might be possible to redefine it to just print the version to stdout
> and just exit. But that also means that java -version and java --version
> behaves differently, and I don't know if that really is a good idea.
>
>
I like the idea of repurposing --version. It could be short-wired to
-Xinternalversion. "--version" certainly is snappier and easier to remember
:)

..Thomas

/Magnus
> >
> > Cheers, Thomas
>
>


More information about the jdk-dev mailing list