React Native: JAVA_HOME is not set and no 'java' command could be found in your PATH

前端 未结 9 2180
清歌不尽
清歌不尽 2020-12-23 16:44

I\'ve followed step by step the official Getting Started. I started from a clean linux install and installed everything required as per the \"Building Projects with Native C

9条回答
  •  情书的邮戳
    2020-12-23 17:10

    Windows 10:

    Android Studio -> File -> Other Settings -> Default Project Structure... -> JDK location:

    copy string shown, such as:

    C:\Program Files\Android\Android Studio\jre
    

    In file locator directory window, right-click on "This PC" ->

    Properties -> Advanced System Settings -> Environment Variables... -> System Variables

    click on the New... button under System Variables, then type and paste respectively:

    .......Variable name: JAVA_HOME

    .......Variable value: C:\Program Files\Android\Android Studio\jre

    and hit OK buttons to close out.

    Some installations may require JRE_HOME to be set as well, the same way.

    To check, open a NEW black console window, then type echo %JAVA_HOME% . You should get back the full path you typed into the system variable. Windows 10 seems to support spaces in the filename paths for system variables very well, and does not seem to need ~tilde eliding.

提交回复
热议问题