您可以创建~/.bash_profile
文件。最简单的方法是使用touch工具:touch .bash_profile
。如果bash找不到.bash_profile,则通常会有一个.profile
文件。您可以使用终端从man bash
获取文档。您可以使用任何文本类型编辑器(而不是文字处理器)编辑这些文件中的任何一个。
~/.zshrc
文件。我在 Android Gradle 项目根目录中
gradle app:assembleDebug --stacktrace
但是我遇到了错误
最低支持的Gradle版本为5.4.1。当前版本为5.1。
并且提示信息显示
将/gradle/wrapper/gradle-wrapper.properties更改为gradle-5.4.1-all.zip
但实际上它已经是这样了。
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
那么为什么Gradle没有构建呢?
open .bash_profile
。这通常会使用TextEdit打开文件。 - Billexport PATH=<absolute/path/to/directory>:$PATH
后,您应该运行命令source ~/.bash_profile
来初始化刚刚添加的变量,或者打开一个新终端。 - the_prole