asdf-java
asdf-java copied to clipboard
What's the asdf sub-command to show the current global java version?
cat $HOME/.tool-versions | grep "^java"? So the actual answer is, there is no such command.
Not sure if this is a newer feature of asdf, but you could run asdf list java in a directory that doesn't specify .tool-versions (a directory where you would expect your global java version to apply) and you will get a list of all installed versions of java with an asterisk * next to the version of java being used (which would be the one specified in ~/.tool-versions as @delgurth has noted.
$ asdf list java
java
*adoptopenjdk-17.0.4+101
adoptopenjdk-19.0.1+10