PortValhalla/scripts/Debian/Software/Java/install.sh

22 lines
687 B
Bash
Raw Normal View History

2022-11-15 12:11:54 +00:00
#!/bin/bash
# Elevate script
if [ ! "$UID" -eq 0 ]
then
sudo bash "$BASH_SOURCE";
curl -s "https://get.sdkman.io" | bash;
2023-03-16 19:06:14 +00:00
source "~/.sdkman/bin/sdkman-init.sh";
sdk install gradle 7.5.1;
2022-11-15 12:11:54 +00:00
else
apt install -y wget apt-transport-https;
mkdir -p /etc/apt/keyrings;
2022-11-15 12:11:54 +00:00
wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public \
| tee /etc/apt/keyrings/adoptium.asc;
2022-11-15 12:11:54 +00:00
echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" \
| tee /etc/apt/sources.list.d/adoptium.list;
2022-11-15 12:11:54 +00:00
apt update;
apt install -y temurin-17-jdk;
2022-11-15 12:11:54 +00:00
fi