Such a stupid way to fix it but, I changed the jdk-23 folder's name to jdk-17 and also changed the env value of JAVA_HOME to jdk-17 and it's fixed.