gradle set up
gradle setupのtipsです。
brewでエラーが出る方へ
macOSでのgradleのinstallにはbrewを使用しますが、macOSが古かったりすると失敗します。
brew install gradle
このエラーが出る方。
Error
Error: You are using macOS 12.
We (and Apple) do not provide support for this old version.
It is expected behaviour that some formulae will fail to build in this old version.
It is expected behaviour that Homebrew will be buggy and slow.
Do not create any issues about this on Homebrew's GitHub repositories.
Do not create any issues even if you think this message is unrelated.
Any opened issues will be immediately closed without response.
Do not ask for help from Homebrew or its maintainers on social media.
You may ask for help in Homebrew's discussions but are unlikely to receive a response.
Try to figure out the problem yourself and submit a fix as a pull request.
We will review it but may or may not accept it.
公式サイトに従ってインストール
そんな時は本家gradle公式サイトの手順でインストールします。
Download by the following url:
https://gradle.org/install/#helpful-information
% sudo unzip -d /opt/gradle gradle-8.11.1-bin.zip
配置する。
% ls /opt/gradle/gradle-8.11.1
LICENSE NOTICE README bin init.d lib
パスを通す。.zshrc
とかに書き込み。
% export PATH=$PATH:/opt/gradle/gradle-8.11.1/bin
成功。
% gradle -v
Welcome to Gradle 8.11.1!
Here are the highlights of this release:
- Parallel load and store for Configuration Cache
- Java compilation errors at the end of the build output
- Consolidated report for warnings and deprecations
For more details see https://docs.gradle.org/8.11.1/release-notes.html
------------------------------------------------------------
Gradle 8.11.1
------------------------------------------------------------
Build time: 2024-11-20 16:56:46 UTC
Revision: 481cb05a490e0ef9f8620f7873b83bd8a72e7c39
Kotlin: 2.0.20
Groovy: 3.0.22
Ant: Apache Ant(TM) version 1.10.14 compiled on August 16 2023
Launcher JVM: 20.0.1 (Oracle Corporation 20.0.1+9-29)
Daemon JVM: /Users/mariko.shozawa/Library/Java/JavaVirtualMachines/openjdk-20.0.1/Contents/Home (no JDK specified, using current Java home)
OS: Mac OS X 12.6.3 aarch64