From b5d3bbc08188e4c9dedee5fed0b94c52390e78ac Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 15 Nov 2022 13:11:54 +0100 Subject: [PATCH] Add script for installing java --- ManuSurface/setup.sh | 1 + scripts/PopOS/software/java.sh | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100755 scripts/PopOS/software/java.sh diff --git a/ManuSurface/setup.sh b/ManuSurface/setup.sh index 48bf4919..f682cb35 100755 --- a/ManuSurface/setup.sh +++ b/ManuSurface/setup.sh @@ -40,6 +40,7 @@ source "$softwareRoot/oh-my-posh.sh" source "$softwareRoot/logo-ls.sh" source "$softwareRoot/codium.sh" source "$softwareRoot/code.sh" +source "$softwareRoot/java.sh" source "$softwareRoot/tea.sh" # Install other flatpaks diff --git a/scripts/PopOS/software/java.sh b/scripts/PopOS/software/java.sh new file mode 100755 index 00000000..68b92023 --- /dev/null +++ b/scripts/PopOS/software/java.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Elevate script +if [ ! "$UID" -eq 0 ] +then + sudo bash "$BASH_SOURCE" +else + apt install -y wget apt-transport-https + mkdir -p /etc/apt/keyrings + + wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public \ + | tee /etc/apt/keyrings/adoptium.asc + + 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 + + apt update + apt install -y temurin-17-jdk +fi