0

I am running below command to see available versions.

/usr/libexec/java_home -V

and the result is: (I have deleted java8 folder from VirtualMachines directory)

Matching Java Virtual Machines (2):
    11.0.13, x86_64:    "Amazon Corretto 11"    /Users/userName/Library/Java/JavaVirtualMachines/corretto-11.0.13/Contents/Home
    11.0.13, x86_64:    "OpenJDK 11.0.13"   /Users/userName/Library/Java/JavaVirtualMachines/semeru-11.0.13/Contents/Home

And I am entering

export JAVA_HOME=/Users/username/Library/Java/JavaVirtualMachines/semeru-11.0.13/Contents/Home

or

export JAVA_HOME=`/usr/libexec/java_home -v 11`

I am restarting termina but still when I enter java -version the result is

openjdk version "1.8.0_312"

I do not remember whether I have installed them via site or homebrew but now i cannot change it. How can i achieve it ?

abidinberkay
  • 1,857
  • 4
  • 36
  • 68
  • 1
    If your restart the terminal all the manual exports you do are lost unless they are written in some file that is sourced during terminal startup. – luk2302 Dec 30 '21 at 10:46
  • Also, running executables in the terminal will use the PATH variable, not JAVA_HOME. – dunni Dec 30 '21 at 10:51

0 Answers0