diff --git a/app/src/main/java/com/oracle/javafx/scenebuilder/app/SceneBuilderApp.java b/app/src/main/java/com/oracle/javafx/scenebuilder/app/SceneBuilderApp.java index 4472a22ac..f9630b1ce 100644 --- a/app/src/main/java/com/oracle/javafx/scenebuilder/app/SceneBuilderApp.java +++ b/app/src/main/java/com/oracle/javafx/scenebuilder/app/SceneBuilderApp.java @@ -34,52 +34,32 @@ import com.oracle.javafx.scenebuilder.app.DocumentWindowController.ActionStatus; import com.oracle.javafx.scenebuilder.app.about.AboutWindowController; -import com.oracle.javafx.scenebuilder.kit.preferences.MavenPreferences; -import com.oracle.javafx.scenebuilder.kit.ResourceUtils; -import com.oracle.javafx.scenebuilder.kit.ToolTheme; -import com.oracle.javafx.scenebuilder.kit.alert.ImportingGluonControlsAlert; -import com.oracle.javafx.scenebuilder.kit.alert.SBAlert; import com.oracle.javafx.scenebuilder.app.i18n.I18N; import com.oracle.javafx.scenebuilder.app.menubar.MenuBarController; import com.oracle.javafx.scenebuilder.app.preferences.PreferencesController; import com.oracle.javafx.scenebuilder.app.preferences.PreferencesRecordGlobal; import com.oracle.javafx.scenebuilder.app.preferences.PreferencesWindowController; import com.oracle.javafx.scenebuilder.app.registration.RegistrationWindowController; -import com.oracle.javafx.scenebuilder.kit.library.util.JarReport; -import com.oracle.javafx.scenebuilder.kit.template.Template; -import com.oracle.javafx.scenebuilder.kit.template.TemplatesWindowController; -import com.oracle.javafx.scenebuilder.kit.template.Type; import com.oracle.javafx.scenebuilder.app.tracking.Tracking; import com.oracle.javafx.scenebuilder.app.util.AppSettings; import com.oracle.javafx.scenebuilder.app.welcomedialog.WelcomeDialogWindowController; +import com.oracle.javafx.scenebuilder.kit.ResourceUtils; +import com.oracle.javafx.scenebuilder.kit.ToolTheme; +import com.oracle.javafx.scenebuilder.kit.alert.ImportingGluonControlsAlert; +import com.oracle.javafx.scenebuilder.kit.alert.SBAlert; import com.oracle.javafx.scenebuilder.kit.editor.EditorController; import com.oracle.javafx.scenebuilder.kit.editor.EditorPlatform; import com.oracle.javafx.scenebuilder.kit.editor.panel.util.dialog.AlertDialog; import com.oracle.javafx.scenebuilder.kit.editor.panel.util.dialog.ErrorDialog; import com.oracle.javafx.scenebuilder.kit.library.BuiltinLibrary; import com.oracle.javafx.scenebuilder.kit.library.user.UserLibrary; +import com.oracle.javafx.scenebuilder.kit.library.util.JarReport; import com.oracle.javafx.scenebuilder.kit.metadata.Metadata; +import com.oracle.javafx.scenebuilder.kit.preferences.MavenPreferences; +import com.oracle.javafx.scenebuilder.kit.template.Template; +import com.oracle.javafx.scenebuilder.kit.template.TemplatesWindowController; +import com.oracle.javafx.scenebuilder.kit.template.Type; import com.oracle.javafx.scenebuilder.kit.util.control.effectpicker.EffectPicker; - -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.time.LocalDate; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.CountDownLatch; -import java.util.function.Consumer; -import java.util.logging.Level; -import java.util.logging.Logger; - import javafx.application.Application; import javafx.application.Platform; import javafx.beans.InvalidationListener; @@ -94,6 +74,21 @@ import javafx.stage.FileChooser; import javafx.stage.Stage; +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.time.LocalDate; +import java.util.*; +import java.util.concurrent.CountDownLatch; +import java.util.function.Consumer; +import java.util.logging.Level; +import java.util.logging.LogManager; +import java.util.logging.Logger; + /** * This is the SB main entry point. */ @@ -124,7 +119,12 @@ public enum ApplicationControlAction { private final BooleanBinding startupTasksFinished = Bindings.isEmpty(startupTasks); static { - System.setProperty("java.util.logging.config.file", SceneBuilderApp.class.getResource("/logging.properties").getPath()); + try { + // Ensures logging.properties is applied, whether running application locally or via a JAR + LogManager.getLogManager().readConfiguration(SceneBuilderApp.class.getResourceAsStream("/logging.properties")); + } catch (IOException e) { + throw new RuntimeException("Failed to initialise log manager", e); + } } /*