I am trying to setup Cordova for running cordova-android9.0. My problem is that when I downgraded my java version, it no longer works.

I downloaded [Java 8](https://www.oracle.com/java/technologies/downloads/#java8-windows) and set my environment variables to:
**User variable Path** to:
`C:\Program Files\Java\jdk1.8.0_351\bin`
and Gradle to this version:
`C:\Gradle\gradle-4.10.3\bin` (recommended by Cordova)

**System variables:**

```
JAVA_HOME C:\Program Files\Java\jdk1.8.0_351

```

and Path the same as on user variables

When I run `java -version` in terminal it gives me error message:

```
Error occurred during initialization of VM
Failed setting boot class path.

```

I cannot figure out why Java is not responding correctly