title: Switch java home using /usr/libexec/java_home stop working after MacOS upgrade to Big Sur
body: <p>I have a simple script to switch between different JDK versions. However, after MacOs upgrade to Big Sur, it stop working. Not sure if it's related to OS upgrade or not.</p>
  <p>The script <code>setjavahome.sh</code>:</p>
  <pre><code>export JAVA_HOME=`/usr/libexec/java_home -v $1`
  export PATH=$JAVA_HOME/bin:$PATH
  </code></pre>
  <p>Usually, I call
  <code>. setjavahome.sh 1.8</code></p>
  <p>It will switch java home. But now it doesn't do anything.</p>
  <p>If I use <code>/usr/libexec/java_home -V</code>, it's still able to list all the versions.</p>
  <p>Just <code>/usr/libexec/java_home -v</code> stop working.</p>
  <p>Not sure why it suddently stop working.</p>