diff --git a/build.gradle b/build.gradle index 4176526a..f32b4b62 100644 --- a/build.gradle +++ b/build.gradle @@ -96,6 +96,8 @@ distributions { } startScripts { + defaultJvmOpts = ['--add-opens', 'java.base/java.lang=ALL-UNNAMED'] + // placing logback.xml somewhere under src/dist/lib/ keeps it out of // bioformats2raw-*.jar but automatically includes it in the distribution zip // the directory containing logback.xml must be explicitly added to the diff --git a/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java b/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java index 135fa6f2..c6a60d6e 100644 --- a/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java +++ b/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java @@ -1090,6 +1090,10 @@ public DimensionOrder getDimensionOrder() { */ @Override public Integer call() throws Exception { + ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) + LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); + root.setLevel(Level.toLevel(logLevel)); + if (printVersion) { String version = Optional.ofNullable( this.getClass().getPackage().getImplementationVersion() @@ -1118,10 +1122,6 @@ public Integer call() throws Exception { OpenCVTools.loadOpenCV(); - ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) - LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); - root.setLevel(Level.toLevel(logLevel)); - if (progressBars) { setProgressListener(new ProgressBarListener(logLevel)); }