diff --git a/README.md b/README.md index a3cc93d..eead5b4 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Liferay's Course Launcher tool automatically prepares your system and sets up a This tool: -* Checks if Java 21 is installed in your system. If not, it installs Zulu JRE 21 from Azul. +* Checks if Java 21 is installed in your system. If not, it installs Zulu JDK 21 from Azul. * Downloads and configures the course workspace. * Initializes the local Liferay DXP bundle. diff --git a/content-manager-course-setup.ps1 b/content-manager-course-setup.ps1 index dc09875..e0047e8 100644 --- a/content-manager-course-setup.ps1 +++ b/content-manager-course-setup.ps1 @@ -7,7 +7,7 @@ function install-course { # === CONFIGURATION === $JavaRequiredVersion = 21 - $ZuluDownloadUrl = "https://cdn.azul.com/zulu/bin/zulu21.30.15-ca-jre21.0.1-win_x64.zip" + $ZuluDownloadUrl = "https://cdn.azul.com/zulu/bin/zulu21.30.15-ca-jdk21.0.1-win_x64.zip" switch ($CourseKey) { "--publishing-tool-and-content-lifecycle" { @@ -65,7 +65,7 @@ function install-course { # === Download ZIP === Write-Host "📦 Downloading course repository..." - $ProgressPreference = 'SilentlyContinue' + $ProgressPreference = 'SilentlyContinue' Invoke-WebRequest -Uri $RepoUrl -OutFile $ZipPath -UseBasicParsing # === Extract ZIP directly here === @@ -132,11 +132,11 @@ function Get-JavaMajorVersion { $JavaInstallDir = Join-Path $ExtractPath "zulu-java" $JavaMarkerFile = Join-Path $JavaInstallDir ".installed" - function Install-ZuluJRE { - Write-Host "⬇️ Installing Zulu JRE inside: $JavaInstallDir" - $zipFile = "$env:TEMP\zulu-jre.zip" + function Install-ZuluJDK { + Write-Host "⬇️ Installing Zulu JDK inside: $JavaInstallDir" + $zipFile = "$env:TEMP\zulu-jdk.zip" - $ProgressPreference = 'SilentlyContinue' + $ProgressPreference = 'SilentlyContinue' Invoke-WebRequest -Uri $ZuluDownloadUrl -OutFile $zipFile -UseBasicParsing Expand-Archive -Path $zipFile -DestinationPath $JavaInstallDir Remove-Item $zipFile @@ -161,7 +161,7 @@ function Get-JavaMajorVersion { $env:JAVA_HOME = $ZuluPath $env:Path = "$ZuluPath\bin;$env:Path" } else { - Install-ZuluJRE + Install-ZuluJDK } } else { Write-Host "☕ System Java version $javaMajor is OK." diff --git a/content-manager-course-setup.sh b/content-manager-course-setup.sh index 1c104db..c550d70 100755 --- a/content-manager-course-setup.sh +++ b/content-manager-course-setup.sh @@ -140,18 +140,18 @@ fetch_text() { fi } -install_zulu_jre() { +install_zulu_jdk() { local ARCH ARCH=$(uname -m) [[ "$ARCH" == "x86_64" ]] && ARCH="x64" [[ "$ARCH" =~ (arm64|aarch64) ]] && ARCH="aarch64" - echo "🌐 Fetching Zulu JRE URL..." + echo "🌐 Fetching Zulu JDK URL..." local ZULU_URL - ZULU_URL=$(fetch_text "https://api.azul.com/zulu/download/community/v1.0/bundles/latest/?java_version=${JAVA_REQUIRED_VERSION}&os=${OS}&arch=${ARCH}&ext=tar.gz&bundle_type=jre&javafx=false&release_status=ga&hw_bitness=64" \ - | grep -oE '"download_url"[ ]*:[ ]*"[^"]+"' | head -n 1 | cut -d '"' -f4) + ZULU_URL=$(fetch_text "https://api.azul.com/zulu/download/community/v1.0/bundles/latest/?java_version=${JAVA_REQUIRED_VERSION}&os=${OS}&arch=${ARCH}&ext=tar.gz&bundle_type=jdk&javafx=false&release_status=ga&hw_bitness=64" \ + | grep -oE '"url"[ ]*:[ ]*"[^"]+"' | tail -n 1 | cut -d '"' -f4) - echo "⬇️ Downloading Zulu JRE..." + echo "⬇️ Downloading Zulu JDK..." mkdir -p "$JAVA_DIR" local TMP_TAR="${RUNTIME_DIR}/zulu.tar.gz" mkdir -p "$RUNTIME_DIR" @@ -166,7 +166,7 @@ install_zulu_jre() { } use_or_install_java() { - # Prefer the managed per-user JRE if present (idempotent across runs) + # Prefer the managed per-user JDK if present (idempotent across runs) if [[ -x "$JAVA_DIR/bin/java" ]]; then export JAVA_HOME="$JAVA_DIR" export PATH="$JAVA_HOME/bin:$PATH" @@ -183,8 +183,8 @@ use_or_install_java() { fi fi - # Else, install our managed JRE 21 - install_zulu_jre + # Else, install our managed JDK 21 + install_zulu_jdk } # === TOOLING === @@ -223,4 +223,4 @@ echo "🛠 Setting up course environment..." chmod +x ./gradlew || true ./gradlew initBundle -echo "✅ Done. Liferay bundle initialized. You may proceed to start your Liferay application now." \ No newline at end of file +echo "✅ Done. Liferay bundle initialized. You may proceed to start your Liferay application now."