1
[email protected] ~/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パスを変更しましたが、それでも失敗しました。
これは私のJava JDKのバージョンです、それは正しいですか? 'OpenJDKのバージョン "1.8.0_131" OpenJDKのランタイム環境(1.8.0_131-8u131-b11-0ubuntu1.16.04.2-B11を構築) OpenJDKの64ビットサーバーVM(25.131-B11、混合モードを構築する)' – ZiSean
うんそれは正しいjdkのように思える。あなたのjavahomeは、新しくインストールされたjdkへのパスになります。私のものは 'C:\ Program Files \ Java \ jdk1.8.0_101'です。あなたの見た目は少し違って見えるかもしれませんが、そういうものかもしれません。 –