As an initial setup I have installed jdk 15.0.2 and gradle 6.7 in my machine. First I installed jdk 15.0.2 and added JAVA_HOME path in mac terminal using below code
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk15.0.2.jdk/Contents/Home"
export PATH=$JAVA_HOME/bin:$PATH
Then I installed gradle 6.7 and added GRADLE_HOME path in mac terminal using below code
export GRADLE_HOME="/opt/gradle/gradle-6.7/bin"
export PATH=$PATH:/opt/gradle/gradle-6.7/bin
Both JAVA_HOME and GRADLE_HOME are placed under the same name PATH Now while checking the java -version it is getting correct version and while checking
gradle -version
it is getting
gradle: command not found
Is there any way to solve this issue