From 3ac6d19f5649e936732a046b4deda69845924659 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Wed, 18 Oct 2023 17:54:00 +0200 Subject: [PATCH] Improve error message. Fixes #521 --- .../buildtools/utils/NativeImageConfigurationUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/native-maven-plugin/src/main/java/org/graalvm/buildtools/utils/NativeImageConfigurationUtils.java b/native-maven-plugin/src/main/java/org/graalvm/buildtools/utils/NativeImageConfigurationUtils.java index de6cf262e..2dadfedc3 100644 --- a/native-maven-plugin/src/main/java/org/graalvm/buildtools/utils/NativeImageConfigurationUtils.java +++ b/native-maven-plugin/src/main/java/org/graalvm/buildtools/utils/NativeImageConfigurationUtils.java @@ -84,14 +84,15 @@ public static Path getJavaHomeNativeImage(String javaHomeVariable, Boolean failF throw new MojoExecutionException("Determining GraalVM installation failed with message: " + e.getMessage()); } } else if (failFast) { - throw new MojoExecutionException("'" + GU_EXE + "' tool was not found. This probably means that JDK at is not a GraalVM distribution."); + throw new MojoExecutionException("'" + GU_EXE + "' tool was not found in your " + javaHomeVariable + "." + + "This probably means that the JDK at '" + graalHomePath + "' is not a GraalVM distribution."); } } if (!Files.exists(nativeImageExe)) { if (failFast) { throw new RuntimeException("native-image is not installed in your " + javaHomeVariable + "." + - "This probably means that JDK at is not a GraalVM distribution."); + "This probably means that the JDK at '" + graalHomePath + "' is not a GraalVM distribution."); } else { return null; }