Make a note of the part that was a little clogged when building the environment of Android Studio on mac.
After installing Android Studio on my mac, when I tried to build with the following command outside Android Studio, the following error message and a dialog like a squeeze were displayed, and I was asked to install the JDK.
Build commands and error messages
$ ./gradlew assembleDebug
No Java runtime present, requesting install.
Dialog asking you to install the JDK
Android Studio already includes the JDK, so you can do it through the path.
The specific path can be found by selecting SDK Location in the left pane on the Android Studio menu> File> Project Structure screen and looking at the JDK Location.
By the way, in the hint of this item, it was stated that "If you want to use it in an external process, add this path to JAVA_HOME
".
After writing the confirmed path in the ~/.zprofile
file as follows, restart the terminal and the build command will be available.
.zprofile
export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"
Recommended Posts