Skip to content

Commit

Permalink
Add OpenJDK module
Browse files Browse the repository at this point in the history
Fixes #18

Will require an addition to configs. Didn't want to add it to base module
  • Loading branch information
AaronJackson committed Nov 1, 2023
1 parent 360215e commit 29fe4fb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions modules/openjdk.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
$ProgressPreference = 'SilentlyContinue' # Disable (slow) progress bar

Set-Location C:\Tools

$OPENJDK_URL="https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9.1/OpenJDK17U-jdk_x64_windows_hotspot_17.0.9_9.msi"
$OPENJDK_HASH="cd7b319f6fbd7efc68a0e464c55c7f2a28d6b8be3d0bcda315a16f885c57cadb"

Invoke-WebRequest -Uri ${OPENJDK_URL} -OutFile OpenJDK17.msi
$hash = Get-FileHash -Path OpenJDK17.msi -Algorithm SHA256

if ( ${OPENJDK_HASH} -ne $hash.Hash ) {
throw("Invalid OpenJDK installer hash")
}

msiexec /i OpenJDK17.msi ADDLOCAL=FeatureJavaHome /quiet
8 changes: 8 additions & 0 deletions modules/openjdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -eu

sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \
wget apt-transport-https gnupg
sudo apt-get -y -q update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y temurin-17-jdk

0 comments on commit 29fe4fb

Please sign in to comment.