M1 安装gradle
今天安装gradle(安装教程)后
查看版本后gradle -version
报错信息如下
FAILURE: Build failed with an exception.
* What went wrong:
Gradle could not start your build.
> Could not initialize native services.
> Failed to load native library 'libnative-platform.dylib' for Mac OS X x86_64.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
看了大神的博客:
解决办法:
查看用户目录下.gradle是否有权限
ls ~/.gradle
果然没有权限,果断赋予权限
sudo chmod -R 777 .gradle
执行后再次查看
Welcome to Gradle 7.4.2!
Here are the highlights of this release:
- Aggregated test and JaCoCo reports
- Marking additional test source directories as tests in IntelliJ
- Support for Adoptium JDKs in Java toolchains
For more details see https://docs.gradle.org/7.4.2/release-notes.html
------------------------------------------------------------
Gradle 7.4.2
------------------------------------------------------------
Build time: 2022-03-31 15:25:29 UTC
Revision: 540473b8118064efcc264694cbcaa4b677f61041
Kotlin: 1.5.31
Groovy: 3.0.9
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 1.8.0_333 (Oracle Corporation 25.333-b02)
OS: Mac OS X 12.4 x86_64