[ad_1]
I’m trying to make a fix regarding this topic: https://github.com/corretto/corretto-11/issues/124#issuecomment-675629775
In my Spring Boot App, but the Exception is not catching the error and the application stops.
@PostConstruct
public void loadFonts() {
Properties props = System.getProperties();
props.put("sun.awt.fontconfig", "/var/task/fontconfig.properties");
String[] fonts;
try {
fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
} catch (Exception ex) {
LOGGER.warn("Reloading Fonts"); //never enters here
}
fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
for (String font : fonts) {
LOGGER.info(font);
}
}
How can I catch the exception and continue the code?
[ad_2]