当我在项目文件夹中运行
与Java相同:
如何为
./gradlew
时,我会得到以下结果:./gradlew
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.
与Java相同:
which java
/usr/bin/java
/usr/bin/java
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.
我在Android Studio中安装了JDK,似乎是安装在~/Library/Android/sdk/sources/android-28
目录下。
设置export JAVA_HOME=/Users/mrgloom/Library/Android/sdk/sources/android-28/
或者export JAVA_HOME=/Users/mrgloom/Library/Android/sdk
会产生错误,如下:
ERROR: JAVA_HOME is set to an invalid directory: /Users/mrgloom/Library/Android/sdk/sources/android-28/
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
如何为
gradlew
指定Java路径?
brew install openjdk@8
- OneCricketeer