From 5753c2993c93c6b51c8e546f2c7269e1ce78926a Mon Sep 17 00:00:00 2001 From: Glavo Date: Mon, 6 Feb 2023 22:44:48 +0800 Subject: [PATCH] Allow users to override system properties (#2062) * Allow users to override system properties * update --- HMCL/src/main/java/org/jackhuang/hmcl/Main.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/Main.java b/HMCL/src/main/java/org/jackhuang/hmcl/Main.java index ff6ac4cb0..09d0787c1 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/Main.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/Main.java @@ -56,10 +56,10 @@ public final class Main { public static void main(String[] args) { System.setProperty("java.net.useSystemProxies", "true"); - System.setProperty("http.agent", "HMCL/" + Metadata.VERSION); System.setProperty("javafx.autoproxy.disable", "true"); + System.getProperties().putIfAbsent("http.agent", "HMCL/" + Metadata.VERSION); // Fix title bar not displaying in GTK systems - System.setProperty("jdk.gtk.version", "2"); + System.getProperties().putIfAbsent("jdk.gtk.version", "2"); checkDirectoryPath();