折腾:
【未解决】VSCode中如何安装gradle和配置build.gradle
期间,需要先去mac中安装gradle
看到官网了:
可以直接下载到二进制:
或者去看看 mac中安装gradle,是否有更合适的办法,比如brew?
mac install gradle
感觉是:mac中,是可以用:
brew install gradle
去安装gradle。但是版本不受自己Gradle控制。
部分Linux发行版安装出来的gradle,没官网的兼容性好?
所以,安全期间,还是用上面下载的gradle的二进制包吧。
所以再去把gradle的路径,加到环境变量中
都没有提到,别处看到别人提到的:GRADLE_HOME
提到了:GRADLE_HOME
去加到此处启动脚本中:
~ vi ~/.bashrc
加上:
export GRADLE_HOME=/Users/crifan/dev/dev_tool/java/gradle/gradle-6.0.1 export PATH=$GRADLE_HOME/bin:$PATH
再去source生效,echo确认:
➜ ~ source ~/.bashrc ➜ ~ echo $GRADLE_HOME /Users/crifan/dev/dev_tool/java/gradle/gradle-6.0.1 ➜ ~ which gradle /Users/crifan/dev/dev_tool/java/gradle/gradle-6.0.1/bin/gradle
看看版本:
➜ ~ gradle --version Welcome to Gradle 6.0.1! Here are the highlights of this release: - Substantial improvements in dependency management, including - Publishing Gradle Module Metadata in addition to pom.xml - Advanced control of transitive versions - Support for optional features and dependencies - Rules to tweak published metadata - Support for Java 13 - Faster incremental Java and Groovy compilation - New Zinc compiler for Scala - VS2019 support - Support for Gradle Enterprise plugin 3.0 For more details see https://docs.gradle.org/6.0.1/release-notes.html ------------------------------------------------------------ Gradle 6.0.1 ------------------------------------------------------------ Build time: 2019-11-18 20:25:01 UTC Revision: fad121066a68c4701acd362daf4287a7c309a0f5 Kotlin: 1.3.50 Groovy: 2.5.8 Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019 JVM: 1.8.0_112 (Oracle Corporation 25.112-b16) OS: Mac OS X 10.14.6 x86_64
How do I install Gradle in Mac OS X? | Kode Java
macos – Install / upgrade gradle on Mac OS X – Stack Overflow
【总结】
此处,mac中安装gradle,简单省事的话,可以用:
brew install gradle
也可以自己下载最新版的二进制包,然后自己把对应路径加到环境变量中。
比如把
export GRADLE_HOME=/Users/crifan/dev/dev_tool/java/gradle/gradle-6.0.1 export PATH=$GRADLE_HOME/bin:$PATH
加到
~/.bashrc
中。
转载请注明:在路上 » 【已解决】Mac中安装Gradle