Does react-native support jdk 17?

To know if this is a java version-related issue, You need to check your Gradle version.

currently only Gradle version 7.3 support java 17.

You can check gradle compatibility matrix to check.

you can check your version with the command line by typing gradlew.bat -version

If your Gradle is version 7.3 then it has nothing to do with the JDK version.


So I solved this issue by installing JDK 16 on my system and everything is solved and running fine. I don't know if the problem was with Gradle or JDK or react-native but hope that in the future jdk 17 is supported.

If you have the same issue then you can go to: jdk 16

1)Download and Install the JDK 16.

2)Add the path to your jdk in the PATH in your system environment variable.

3)Open cmd and do java -version you should see something like

java version "16.0.2" 2021-07-20
Java(TM) SE Runtime Environment (build 16.0.2+7-67)
Java HotSpot(TM) 64-Bit Server VM (build 16.0.2+7-67, mixed mode, sharing)