Skip to content

Commit a0db473

Browse files
GlavoJohan Vos
authored and
Johan Vos
committedMar 29, 2022
8280369: native library cache should be platform/arch specific
Reviewed-by: jvos
1 parent d1fb3d3 commit a0db473

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎modules/javafx.graphics/src/main/java/com/sun/glass/utils/NativeLibLoader.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -235,8 +235,9 @@ private static boolean installLibraryFromResource(String libraryName, List<Strin
235235
private static String cacheLibrary(InputStream is, String name, Class caller) throws IOException {
236236
String jfxVersion = System.getProperty("javafx.runtime.version", "versionless");
237237
String userCache = System.getProperty("javafx.cachedir", "");
238+
String arch = System.getProperty("os.arch");
238239
if (userCache.isEmpty()) {
239-
userCache = System.getProperty("user.home") + "/.openjfx/cache/" + jfxVersion;
240+
userCache = System.getProperty("user.home") + "/.openjfx/cache/" + jfxVersion + "/" + arch;
240241
}
241242
File cacheDir = new File(userCache);
242243
boolean cacheDirOk = true;
@@ -257,7 +258,8 @@ private static String cacheLibrary(InputStream is, String name, Class caller) th
257258
}
258259
if (!cacheDirOk) {
259260
String username = System.getProperty("user.name", "anonymous");
260-
String tmpCache = System.getProperty("java.io.tmpdir") + "/.openjfx_" + username + "/cache/" + jfxVersion;
261+
String tmpCache = System.getProperty("java.io.tmpdir") + "/.openjfx_" + username
262+
+ "/cache/" + jfxVersion + "/" + arch;
261263
cacheDir = new File(tmpCache);
262264
if (cacheDir.exists()) {
263265
if (!cacheDir.isDirectory()) {

0 commit comments

Comments
 (0)
Please sign in to comment.