I'm not familiar with SDKMan, but this short script in my bin directory works in Linux for me. Hopefully it does so in macOS:
#!/bin/sh
export JAVA_HOME=/home/me/java/jdk-17
export PATH=$JAVA_HOME/bin:$PATH
From the command line I have to call it this way: . jdk17