$ brew install openjdk@17
export PATH
$ echo 'export PATH="/usr/local/opt/openjdk@17/bin:$PATH"' >> ~/.zshrc
Check installation
$ java --version openjdk 17.0.11 2024-04-16
Link the JDK into the MacOS JVM Dir
$ sudo ln -sfn /usr/local/opt/openjdk@17/libexec/openjdk.jdk \ /Library/Java/JavaVirtualMachines/openjdk-17.jdk
Gradle Installation
$ brew install gradle
Check Installation
$ gradle -v
Output
------------------------------------------------------------
Gradle 8.7
------------------------------------------------------------
Build time: 2024-03-22 15:52:46 UTC
Revision: 650af14d7653aa949fce5e886e685efc9cf97c10
Create project
$ gradle init --type java-application --dsl groovy