This is always an issue for testing when you first try to setup your environment. Here is the solution: First, find your Java path, it’s under /Library/Java/JavaVirtualMachines Open bash_profile : nano ~/.bash_profile Then add JAVA_HOME and bin configuration to your bash_profile : export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home JAVA_HOME=$(/usr/libexec/java_home) export PATH=${JAVA_HOME}/bin:$PATH