React-Native: ERROR: requires JDK11 or higher. Incompatible major version detected: '8'

Viewed 4194

after running npm install and trying to build my app I get the following error:

**************************************************************************************************************



ERROR: requires JDK11 or higher.
Incompatible major version detected: '8'



**************************************************************************************************************






FAILURE: Build failed with an exception.

* What went wrong:
Could not dispatch a message to the daemon.

I have no idea how to fix it.

2 Answers

You need to install the JDK 11

If you already have it, then you might need to review your environmental variables to make sure they are pointing to the right version.

WORKS ON WINDOWS!

First Step you should install https://www.oracle.com/java/technologies/javase/jdk11-archive-downloads.html

make sure you install it on the same folder as where the OpenJDK's installed before, mine installed on C:\Program Files\OpenJDK, you can check it on the next step.

Then go search Edit the system environment variables Edit the system environment variables

Click On Environment Variables 2

then change the JAVA_HOME Value location to your JDK 11's Folder you installed before 3

Save it and restart you PC

Related