diff --git a/.github/workflow-samples/groovy-dsl/gradle/wrapper/gradle-wrapper.jar b/.github/workflow-samples/groovy-dsl/gradle/wrapper/gradle-wrapper.jar
index c1962a7..033e24c 100644
Binary files a/.github/workflow-samples/groovy-dsl/gradle/wrapper/gradle-wrapper.jar and b/.github/workflow-samples/groovy-dsl/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/.github/workflow-samples/groovy-dsl/gradle/wrapper/gradle-wrapper.properties b/.github/workflow-samples/groovy-dsl/gradle/wrapper/gradle-wrapper.properties
index 2c3425d..a7c2bd1 100644
--- a/.github/workflow-samples/groovy-dsl/gradle/wrapper/gradle-wrapper.properties
+++ b/.github/workflow-samples/groovy-dsl/gradle/wrapper/gradle-wrapper.properties
@@ -1,7 +1,8 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionSha256Sum=e111cb9948407e26351227dabce49822fb88c37ee72f1d1582a69c68af2e702f
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
+distributionSha256Sum=38f66cd6eef217b4c35855bb11ea4e9fbc53594ccccb5fb82dfd317ef8c2c5a3
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
 networkTimeout=10000
+validateDistributionUrl=true
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
diff --git a/.github/workflow-samples/groovy-dsl/gradlew b/.github/workflow-samples/groovy-dsl/gradlew
index aeb74cb..fcb6fca 100755
--- a/.github/workflow-samples/groovy-dsl/gradlew
+++ b/.github/workflow-samples/groovy-dsl/gradlew
@@ -130,10 +130,13 @@ location of your Java installation."
     fi
 else
     JAVACMD=java
-    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+    if ! command -v java >/dev/null 2>&1
+    then
+        die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
 
 Please set the JAVA_HOME variable in your environment to match the
 location of your Java installation."
+    fi
 fi
 
 # Increase the maximum file descriptors if we can.