gpt4 book ai didi

android - Reactnative $JAVA_HOME 路径错误

转载 作者:行者123 更新时间:2023-11-30 00:31:57 26 4
gpt4 key购买 nike

zzz@zzz-PC ~/AndroidStudioProjects/Example $ react-native run-android
Scanning 555 folders for symlinks in /home/zzz/AndroidStudioProjects/Example/node_modules (16ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...

ERROR: JAVA_HOME is set to an invalid directory: /usr/lib/jvm/java-9-oracle

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”命令后,任何人都可以说出问题所在。我在/etc/environment 中更改了我的 JAVA_HOME 路径,它仍然失败。

最佳答案

您需要指向一个 jdk,目前您指向一个 JVM。去here并下载合适的jdk并安装。然后将您的 JAVA_HOME 变量切换到 jdk 的新路径。

关于android - Reactnative $JAVA_HOME 路径错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44163456/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com