asdf-java icon indicating copy to clipboard operation
asdf-java copied to clipboard

What's the asdf sub-command to show the current global java version?

Open paul-hammant opened this issue 5 years ago • 2 comments

paul-hammant avatar Jan 14 '21 16:01 paul-hammant

cat $HOME/.tool-versions | grep "^java"? So the actual answer is, there is no such command.

delgurth avatar Apr 10 '21 21:04 delgurth

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

PsukheDelos avatar Feb 09 '23 19:02 PsukheDelos