I have no idea how you initialize a new project for Cordova.
Some frameworks generate Gradle builds for you.
Some are just plugins you apply to a build you create yourself from scratch.
Even if you need to create the build from scratch yourself, you usually have a proper IDE like IntelliJ IDEA that has Gradle built-in and can be used to create a new Gradle build from scratch.
If not, you can either use the wrapper of any other build to use the init task for a new project, or you can use an installed Gradle version, which is practically the only situation where you would / should use an installed Gradle version.
As of Cordova-Android 6.4.0, Gradle is required to be installed.
When installing on Windows, you need to add the path to the Gradle’s binary directory to your path environment variable. See Setting Environment Variables) on how to configure system environment variables.
Note: This is the system’s Gradle version. The system’s Gradle binary will create the Gradle Wrapper file that declares and obtains the appropriate version of Gradle needed for building the Android application. The system-level and project-level version of Gradle may not and does not need to match. The project-level’s version of Gradle is defined in the Cordova-Android’s package and set based on what Android supports.
I use Android Studio IDE, and PHPStorm IDE, as I am PHP Web Developer, too.
Well, as I said, this is a Gradle forum, not a Cordova forum.
You should ask in some Cordova community.
From what I see on that page from a 10 seconds look it seems you indeed need to have Gradle “installed”, which in the end means you could also add a path like <GRADLE_USER_HOME>/wrapper/dists/gradle-8.4-bin/.../gradle-8.4/bin to your PATH and that would be enough.
But as far as I understood from quickly looking at it, the version you install / configure there is irrelevant for the actual package. As far as I got it, it will only be used to bootstrap the Gradle project Cordova generates which will use Gradle version 7.6 for Cordova 12, no matter what you “install” locally. So you will need a Java version that is compatible with the Gradle version you “install” and also with 7.6, so at most Java 19.