#!/usr/bin/env bash
# Install SDKMAN
# Install dependencies
sudo apt update
sudo apt install curl zip unzip sed -y # set probably installed but it doesn't cost anything to double-check
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
# Adding Fish support if fish is installed
if [ -x "$HOME"/.config/fish ] ; then
if [ ! -f "$HOME"/.config/fish/functions/fisher.fish ] ; then # install fisher if not already installed
curl -sL https://git.io/fisher | fish -c 'source && fisher install jorgebucaran/fisher'
fi
fish -c 'fisher install reitzig/sdkman-for-fish'
echo -e "\nSDKMAN (Java install manager) installed!"
# Install Temurin build according with https://whichjdk.com/#adoptium-eclipse-temurin
sdk install java 17.0.1-tem
# Upgrade to latest java version in case the version above isn't
sdk upgrade
echo -e "\nJava (Temurin) installed! 🎉"