From 1025c323cfb9daa58a596a64061802e77bd20cc8 Mon Sep 17 00:00:00 2001 From: eostermueller Date: Sun, 19 Jul 2020 10:16:57 -0500 Subject: [PATCH] improved launch error msgs --- .../com/github/eostermueller/snail4j/Snail4jInstaller.java | 4 +++- .../github/eostermueller/snail4j/launcher/Messages_en_US.java | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/com/github/eostermueller/snail4j/Snail4jInstaller.java b/backend/src/main/java/com/github/eostermueller/snail4j/Snail4jInstaller.java index 6dafabb..c2d1eb9 100644 --- a/backend/src/main/java/com/github/eostermueller/snail4j/Snail4jInstaller.java +++ b/backend/src/main/java/com/github/eostermueller/snail4j/Snail4jInstaller.java @@ -68,7 +68,8 @@ public int preInstallJavaValidation(Configuration cfg) throws MalformedURLExcept if (javac_dir!=null) { cfg.setJavaHome(javac_dir); } else { - info( messages.jreIsNotEnough( Paths.get(JdkUtils.getInstallPathOfThisJvm() ) ) ); + Path pathOfThisJvm = Paths.get(JdkUtils.getInstallPathOfThisJvm() ); + info( messages.jreIsNotEnough( pathOfThisJvm ) ); Path java_home_from_env = ia.get_JAVA_HOME(); info( messages.attemptingToUseJavaHomeToFindJavaCompiler( java_home_from_env ) ); @@ -82,6 +83,7 @@ public int preInstallJavaValidation(Configuration cfg) throws MalformedURLExcept errorCount++; } } else { + error( messages.JAVA_HOME_mustPointToCurrentJava(java_home_from_env, pathOfThisJvm)); errorCount++; } } diff --git a/backend/src/main/java/com/github/eostermueller/snail4j/launcher/Messages_en_US.java b/backend/src/main/java/com/github/eostermueller/snail4j/launcher/Messages_en_US.java index 8b065e5..ea608af 100644 --- a/backend/src/main/java/com/github/eostermueller/snail4j/launcher/Messages_en_US.java +++ b/backend/src/main/java/com/github/eostermueller/snail4j/launcher/Messages_en_US.java @@ -156,7 +156,7 @@ public String unsupportedJavaVersion(String currentJavaSpecificationVersion, Pat public String jreIsNotEnough(Path currentJavaPath) { String path = currentJavaPath.toFile().getAbsolutePath(); - return String.format("Is this a JRE? Snail4j instead requires a JDK. Path to JRE that was used:: \n#### \t\t\t%s", path ); + return String.format("Sure looks like you launched a JRE. Snail4j requires a JDK. Path to JRE that was used:: \n#### \t\t\t%s", path ); } @Override @@ -176,5 +176,4 @@ public String JAVA_HOME_mustPointToCurrentJava(Path JAVA_HOME, Path currentJavaP public String attemptingToUseJavaHomeToFindJavaCompiler(Path java_home_from_env) { return String.format("Attempting to use JAVA_HOME value to locate Java Compiler executable. \n####\t\t\t JAVA_HOME=%s", java_home_from_env.toAbsolutePath().toString() ); } - }