# JDK Installation
- [JDK11 (MacOS - Homebrew)](#Install-JDK-110)
- [JDK11 (MacOS - SDKMAN)](#Install-JDK-11-SDKMAN)
- [JDK17 (Windows - Scoop)](#Using-Scoop)
## MacOS
### Using Homebrew
#### Add the AdoptOpenJdk Homebrew tap
With Homebrew, add the AdoptOpenJdk tap by:
```bash
brew tap AdoptOpenJDK/openjdk
```
#### Install JDK 11
When using ZSH shell in MacOS (default)
```bash
# Install the latest AdoptOpenJDK 11
brew install --cask adoptopenjdk11
# Modify your ~/.zshrc file and the following
export JAVA_HOME=$(/usr/libexec/java_home -v 11)
# do not forget to source it!
source ~/.zshrc
```
When using Bash shell in MacOS (older)
```bash
# Install the latest AdoptOpenJDK 11
brew install --cask adoptopenjdk11
# In your local Bash profile (located in ~/.bash_profile), add
export JAVA_HOME=$(/usr/libexec/java_home -v 11)
# do not forget to source it!
source ~/.bash_profile
# Check Java version
java -version
```
To get the full list of versions supported, read more on AdoptOpenJDK and Homebrew [here](https://github.com/AdoptOpenJDK/homebrew-openjdk)
### Using SDKMAN
#### Get SDKMAN
```bash
curl -s http://get.sdkman.io | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
```
#### Install JDK 11 (SDKMAN)
```bash
# Look for JDK 11 in the SDKMAN repository
sdk list java
# Choose the one you want, and install it!
# For example, using identifier: `11.0.11.hs-adpt` (AdoptOpenJDK 11.0.11 HotSpot JVM)
sdk install java 11.0.11.hs-adpt
```
### Using jenv
TODO
---
## Windows
### Using Scoop
https://scoop.sh/
Scoop is a Windows command-line installer that makes it convenient to install common tooling via the CLI. Scoop allows you to manage updates of the installed tooling.
Scoop is based on `buckets`, and it comes pre-installed with the `main` bucket. To add additional buckets of tools, there's a nifty command to do so. Read on.
#### Add the `java` Bucket
To get access to all install binaries for java, you'll need to add the `java` bucket. Run the following command:
```powershell
scoop bucket add java
// List all available Adoptium-based JREs/JDKs
scoop search temurin
```
#### Install Adoptium Temurin JDK 17
Install Adoptium's Temurin JDK 17 LTS in Powershell
```powershell
scoop install temurin17-jdk
# Refresh powershell
refreshenv
# OR just close the shell and open a new instance
# Check if JRE is available
java -version
# Check if JDK is available
javac -version
```