问题遇到的现象和发生背景
运行react native 报错,java_home 的问题
**ERROR: JAVA_HOME is set to an invalid directory: D:\vscode\JDK11\bin**
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
at makeError (D:\vscode\React-Native\MyProject\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at D:\vscode\React-Native\MyProject\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (D:\vscode\React-Native\MyProject\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\vscode\React-Native\MyProject\node_modules\@react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.