使用cmd在react-native run-android命令中发生错误

时间:2017-11-07 12:30:19

标签: react-native

Scanning folders for symlinks in F:\PROJECTS\ReactNative\albums\node_modules (246ms)
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug)...


ERROR: JAVA_HOME is set to an invalid directory:  C:\Program Files\Java\jdk1.8.0_144

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

在我运行“react-native run-android”命令之后,任何人都可以知道问题是什么。

1 个答案:

答案 0 :(得分:0)

该问题的解决方案是在cmd中键入以下命令:

设置JAVA_HOME = C:\ Program Files \ Java \ jdk1.8.0_144