I get the same issue as in this question when I do react-native run-android. I think it wants java 11 but I want to continue with 1.8. How can I do it?
Asked
Active
Viewed 329 times
3
-
It clearly says that you can't use java 1.8 . To continue with JDK 11 , go to Project Structure > SDK location > Jdk location was moved to Gradle Settings > Gradle JDK drop down menu > Select "Embedded JDK". – LegendSayantan Apr 07 '22 at 12:26
-
when i change it as said ," Task :react-native-gradle-plugin:compileKotlin 'compileJava' task (current target is 1.8) and 'compileKotlin' task (current target is 11) jvm target compatibility should be set to the same Java version." this error not fixed – selcukctn Apr 07 '22 at 12:38
1 Answers
0
what you need to do;
- log into my computer
- right click and select properties
- enter advanced system settings
- add new path name: JAVA_HOME
- select the java 11 jdk location and save it
or
- open cmd for adminstator
- setx JAVA_HOME -m "path"
After doing all of them, delete your old React Native project and install a new one.
or
- open project with android stiduo
- find node_moduls -> react-native-gradle-plugin -> build.gradle -> change java 1.8 to java 11.0
selcukctn
- 175
- 9