From fa15a169d89728af31428d426950eb5a432cf76c Mon Sep 17 00:00:00 2001 From: Vera-Firefly <1964762970@qq.com> Date: Fri, 18 Oct 2024 01:15:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4[=E5=90=AF=E5=8A=A8]:=20?= =?UTF-8?q?=E6=A3=80=E6=9F=A5Native=E7=9B=AE=E5=BD=95=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=AD=98=E5=9C=A8jsph?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/net/kdt/pojavlaunch/utils/JREUtils.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/utils/JREUtils.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/utils/JREUtils.java index 6260d918..3befbc49 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/utils/JREUtils.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/utils/JREUtils.java @@ -427,7 +427,11 @@ private static void checkAndUsedJSPH(final Runtime runtime) { File[] files = dir.listFiles((dir1, name) -> name.startsWith(jsphName)); if (files != null && files.length > 0) { String libName = NATIVE_LIB_DIR + "/" + jsphName + ".so"; - Os.setenv("JSP", libName, true); + try { + Os.setenv("JSP", libName, true); + } catch (Exception e) { + System.err.println("Error setting environment variable: " + e.getMessage()); + } } else { System.out.println("Native: Library " + jsphName + ".so not found, some mod cannot used"); }