I could not comment and thank @joseph-deweese and @tafita-raza due to less contribution but all credits to them.
Basically what i did was , I did not have /jre folder in /Android Studio , so created a new folder copied everything from /jbr folder and in the release file i updated the java version from 21 to 23 which I had installed in mine (check yours with java --version in terminal and replace)
Now add environment variable JAVA_HOME to this path i.e. C:\Program Files\Android\Android Studio\jre for me I think /jbr would also work but I am not touching my config again till the next error