SDKMAN! has a home command that will return the absolute path of any SDK we pass as argument. This can be useful in scripts where we need the absolute path to a SDK. We can specify the name of the SDK after the home command and the version. To use the current version that is set as default we can use as version current.

In the following example we use the home command for several SDKs:

$ sdk home groovy 4.0.3
$ sdk home java 17.0.3-tem
$ sdk home jbake current
$ export ASCIIDOCTORJ_DIR=`sdk home asciidoctorj current`

Written with SDKMAN! 5.15.0.