Now that I'm on Big Sur, I can't set my jdk anymore! I used to do this:
$ /usr/libexec/java_home -v 15
Now it just responds like this:
$ /usr/libexec/java_home -v 15
/Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home
Before Big Sur, this command would always respond with the jdk path for the version I specified. My .bash_profile file has these aliased defined:
alias j15="export JAVA_HOME=`/usr/libexec/java_home -v 15`; java -version"
alias j12="export JAVA_HOME=`/usr/libexec/java_home -v 12`; java -version"
alias j11="export JAVA_HOME=`/usr/libexec/java_home -v 11`; java -version"
alias j10="export JAVA_HOME=`/usr/libexec/java_home -v 10`; java -version"
alias j8="export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_212`; java -version"
alias j7="export JAVA_HOME=`/usr/libexec/java_home -v 1.7`; java -version"
j12
So it would start with Java 12, but I could just type j15 and it would set my jdk to 15. But now none of them work. I can type any of them, but it stays at JDK 12. (I have different projects which require different JDK versions.)
Is there a better way to do this now?