Skip to content

Commit

Permalink
improved launch error msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
eostermueller committed Jul 19, 2020
1 parent 1621031 commit 1025c32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );

Expand All @@ -82,6 +83,7 @@ public int preInstallJavaValidation(Configuration cfg) throws MalformedURLExcept
errorCount++;
}
} else {
error( messages.JAVA_HOME_mustPointToCurrentJava(java_home_from_env, pathOfThisJvm));
errorCount++;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() );
}

}

0 comments on commit 1025c32

Please sign in to comment.