|
32 | 32 | public class JhlClientAdapterFactory extends SVNClientAdapterFactory { |
33 | 33 |
|
34 | 34 | private static final String[] WINDOWSLIBS = new String[] { |
35 | | - "msvcr100", "msvcp100", "zlib-1", |
36 | | - "libapr-1", "libapriconv-1", "libeay32", "ssleay32", |
37 | | - "libcrypto-1_1", "capi", "libssl-1_1", "libaprutil-1", |
38 | | - "dbghelp", "libsasl", "libserf-1", |
39 | | - // libraries as of 1.5 |
| 35 | + "msvcr100", "msvcp100", |
| 36 | + "libapr-1", "libapriconv-1", |
| 37 | + "libcrypto-1_1", "capi", "libssl-1_1", |
| 38 | + "libaprutil-1", |
| 39 | + "libserf-1", |
| 40 | + "libsvn_subr-1", "libsvn_delta-1", "libsvn_diff-1", "libsvn_wc-1", |
| 41 | + "libsvn_fs_util-1", "libsvn_fs_fs-1", "libsvn_fs_x-1", "libsvn_fs-1", |
| 42 | + "libsvn_repos-1", "libsvn_ra-1", "libsvn_client-1" |
| 43 | + }; |
| 44 | + |
| 45 | + private static final String[] WINDOWSLIBS64 = new String[] { |
| 46 | + "msvcr100", "msvcp100", |
| 47 | + "libapr-1", "libapriconv-1", |
| 48 | + "libcrypto-1_1-x64", "capi", "libssl-1_1-x64", |
| 49 | + "libaprutil-1", |
| 50 | + "libserf-1", |
40 | 51 | "libsvn_subr-1", "libsvn_delta-1", "libsvn_diff-1", "libsvn_wc-1", |
41 | 52 | "libsvn_fs_util-1", "libsvn_fs_fs-1", "libsvn_fs_x-1", "libsvn_fs-1", |
42 | 53 | "libsvn_repos-1", "libsvn_ra-1", "libsvn_client-1" |
@@ -106,16 +117,27 @@ public static boolean isAvailable() { |
106 | 117 | // because of a problem in one of these libraries the proper behavior |
107 | 118 | // will still occur -- meaning JavaHL adapter is disabled. |
108 | 119 | if(isOsWindows()) { |
109 | | - |
110 | | - for (int i = 0; i < WINDOWSLIBS.length; i++) { |
111 | | - try { |
112 | | - System.loadLibrary(WINDOWSLIBS[i]); |
113 | | - } catch (Exception e) { |
114 | | - javaHLErrors.append(e.getMessage()).append("\n"); |
115 | | - } catch (UnsatisfiedLinkError e) { |
116 | | - javaHLErrors.append(e.getMessage()).append("\n"); |
117 | | - } |
118 | | - } |
| 120 | + if (is32bit()) { |
| 121 | + for (int i = 0; i < WINDOWSLIBS.length; i++) { |
| 122 | + try { |
| 123 | + System.loadLibrary(WINDOWSLIBS[i]); |
| 124 | + } catch (Exception e) { |
| 125 | + javaHLErrors.append(e.getMessage()).append("\n"); |
| 126 | + } catch (UnsatisfiedLinkError e) { |
| 127 | + javaHLErrors.append(e.getMessage()).append("\n"); |
| 128 | + } |
| 129 | + } |
| 130 | + } else { |
| 131 | + for (int i = 0; i < WINDOWSLIBS64.length; i++) { |
| 132 | + try { |
| 133 | + System.loadLibrary(WINDOWSLIBS64[i]); |
| 134 | + } catch (Exception e) { |
| 135 | + javaHLErrors.append(e.getMessage()).append("\n"); |
| 136 | + } catch (UnsatisfiedLinkError e) { |
| 137 | + javaHLErrors.append(e.getMessage()).append("\n"); |
| 138 | + } |
| 139 | + } |
| 140 | + } |
119 | 141 |
|
120 | 142 | } |
121 | 143 | //workaround to solve Subclipse ISSUE #83 |
@@ -215,6 +237,20 @@ public static boolean isOsWindows() |
215 | 237 | return false; |
216 | 238 | } |
217 | 239 | } |
| 240 | + |
| 241 | + /** |
| 242 | + * Answer whether running on 32-bit JVM |
| 243 | + * @return true when running on 32-bit JVM |
| 244 | + */ |
| 245 | + public static boolean is32bit() |
| 246 | + { |
| 247 | + try { |
| 248 | + return System.getProperty("os.arch").equalsIgnoreCase("x86"); |
| 249 | + } catch (SecurityException ex) { |
| 250 | + // we are not allowed to look at this property |
| 251 | + return false; |
| 252 | + } |
| 253 | + } |
218 | 254 |
|
219 | 255 | /** |
220 | 256 | * @return an error string describing problems during loading platform native libraries (if any) |
|
0 commit comments