Skip to content

Commit b926cdc

Browse files
mkartashevjbrbot
authored and
jbrbot
committed
JBR-7892 Generate a descriptive error message when awt cannot be loaded
1 parent 37cfe64 commit b926cdc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/java.desktop/share/classes/java/awt/Toolkit.java

+8-2
Original file line numberDiff line numberDiff line change
@@ -1290,8 +1290,14 @@ private static void setPlatformResources(ResourceBundle bundle) {
12901290
@SuppressWarnings("restricted")
12911291
static void loadLibraries() {
12921292
if (!loaded) {
1293-
System.loadLibrary("awt");
1294-
loaded = true;
1293+
try {
1294+
System.loadLibrary("awt");
1295+
loaded = true;
1296+
} catch (UnsatisfiedLinkError e) {
1297+
AWTError error = new AWTError("Failed to initialize the window toolkit: " + e.getMessage());
1298+
error.initCause(e);
1299+
throw error;
1300+
}
12951301
}
12961302
}
12971303

0 commit comments

Comments
 (0)