diff --git a/wpiutil/src/main/java/edu/wpi/first/util/RuntimeLoader.java b/wpiutil/src/main/java/edu/wpi/first/util/RuntimeLoader.java index 452cacfe72..5ceaa076ad 100644 --- a/wpiutil/src/main/java/edu/wpi/first/util/RuntimeLoader.java +++ b/wpiutil/src/main/java/edu/wpi/first/util/RuntimeLoader.java @@ -16,17 +16,20 @@ public final class RuntimeLoader { * @return A load error message. */ private static String getLoadErrorMessage(String libraryName, UnsatisfiedLinkError ule) { + String jvmLocation = ProcessHandle.current().info().command().orElse("Unknown"); StringBuilder msg = new StringBuilder(512); msg.append(libraryName) .append(" could not be loaded from path.\n" + "\tattempted to load for platform ") .append(CombinedRuntimeLoader.getPlatformPath()) .append("\nLast Load Error: \n") .append(ule.getMessage()) - .append('\n'); + .append('\n') + .append(String.format("JVM Location: %s\n", jvmLocation)); if (System.getProperty("os.name").startsWith("Windows")) { msg.append( - "A common cause of this error is missing the C++ runtime.\n" - + "Download the latest at https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads\n"); + "A common cause of this error is using a JVM with an incorrect MSVC runtime.\n" + + "Ensure you are using the WPILib JVM (The current running JVM is listed above)\n" + + "See https://wpilib.org/jvmruntime for more information\n"); } return msg.toString(); }