Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ ext {
}

def javaArgs = [
"-Xss8M", "-Dsun.java2d.d3d=false",
"-Dpolyglot.engine.WarnInterpreterOnly=false",
"-Djava.util.Arrays.useLegacyMergeSort=true",
"-Xss8M",
"--add-opens=java.desktop/java.awt=ALL-UNNAMED", "--add-opens=java.desktop/java.awt.geom=ALL-UNNAMED",
"--add-opens=java.desktop/sun.awt.geom=ALL-UNNAMED", "--add-opens=java.base/java.util=ALL-UNNAMED",
"--add-opens=javafx.web/javafx.scene.web=ALL-UNNAMED", "--add-opens=javafx.web/com.sun.webkit=ALL-UNNAMED",
Expand Down
26 changes: 19 additions & 7 deletions src/main/java/net/rptools/maptool/client/LaunchInstructions.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
package net.rptools.maptool.client;

import java.util.Properties;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import org.apache.logging.log4j.LogManager;
Expand All @@ -27,15 +28,26 @@ public class LaunchInstructions {
+ "MapTool will launch anyway, but it is recommended that you increase the maximum memory allocated or don't set a limit.</body></html>";

static {
// This will inject additional data tags in log4j2 which will be picked up by Sentry.io
System.setProperty("log4j2.isThreadContextMapInheritable", "true");
var defaultProperties = new Properties();
defaultProperties.put("sun.java2d.d3d", "false");
defaultProperties.put("sun.java2d.opengl", "false");
defaultProperties.put("polyglot.engine.WarnInterpreterOnly", "false");
defaultProperties.put("java.util.Arrays.useLegacyMergeSort", "true");
// This sets up log4j to capture logging from Java logging manager
if (System.getProperty("java.util.logging.manager") == null) {
System.setProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager");
}
if (System.getProperty(AppUtil.DATADIR_PROPERTY_NAME) == null) {
System.setProperty(AppUtil.DATADIR_PROPERTY_NAME, ".maptool-rptools");
defaultProperties.put("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager");
defaultProperties.put(AppUtil.DATADIR_PROPERTY_NAME, ".maptool-rptools");

for (var entry : defaultProperties.entrySet()) {
var key = entry.getKey().toString();

// Allow the user to provide an alternative value.
if (System.getProperty(key) == null) {
System.setProperty(key, entry.getValue().toString());
}
}

// This will inject additional data tags in log4j2 which will be picked up by Sentry.io
System.setProperty("log4j2.isThreadContextMapInheritable", "true");
ThreadContext.put("OS", System.getProperty("os.name"));
}

Expand Down
Loading