halcyon / asdf-java

A Java plugin for asdf-vm.
MIT License
455 stars 86 forks source link

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

Open paul-hammant opened 3 years ago

delgurth commented 3 years ago

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

PsukheDelos commented 1 year ago

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