diff --git a/modules/util/src/main/java/com/gluonhq/attach/util/Platform.java b/modules/util/src/main/java/com/gluonhq/attach/util/Platform.java index 668e5feb..0ceef4ba 100644 --- a/modules/util/src/main/java/com/gluonhq/attach/util/Platform.java +++ b/modules/util/src/main/java/com/gluonhq/attach/util/Platform.java @@ -65,11 +65,13 @@ public enum Platform { private static final Logger LOGGER = Logger.getLogger(Platform.class.getName()); static { - String os = System.getProperty("os.name", DESKTOP.getName()).toLowerCase(Locale.ROOT); - if (os.contains("mac") || os.contains("win") || os.contains("nux")) { - os = DESKTOP.getName(); + String platform = System.getProperty("javafx.platform", null); + if (platform == null) { + LOGGER.info("javafx.platform is not defined. Desktop will be assumed by default."); + platform = DESKTOP.getName(); } - String name = os.toUpperCase(Locale.ROOT); + + String name = platform.toUpperCase(Locale.ROOT); current = valueOf(name); LOGGER.fine("Current platform: " + current); } diff --git a/modules/util/src/main/java/com/gluonhq/attach/util/impl/DefaultServiceFactory.java b/modules/util/src/main/java/com/gluonhq/attach/util/impl/DefaultServiceFactory.java index 55b945a4..c782584d 100644 --- a/modules/util/src/main/java/com/gluonhq/attach/util/impl/DefaultServiceFactory.java +++ b/modules/util/src/main/java/com/gluonhq/attach/util/impl/DefaultServiceFactory.java @@ -70,7 +70,7 @@ private T createInstance(Platform platform) { LOGGER.log(Level.SEVERE, null, ex); } catch (ClassNotFoundException ex) { // no-op - LOGGER.log(Level.WARNING, "No new instance for " + serviceType); + LOGGER.log(Level.WARNING, "No new instance for " + serviceType + " and class " + fqn); } return null; }