mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
[wpiutil] Make runtime loader exception message slightly better (#7536)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user