@@ -165,13 +165,9 @@ def get_jnius_lib_location(self):
165
165
)
166
166
return libjvm_override_path
167
167
168
- cpu = get_cpu ()
169
168
platform = self .platform
170
- log .debug (
171
- "looking for libjvm to initiate pyjnius, cpu is %s, platform is %s" ,
172
- cpu , platform
173
- )
174
- lib_locations = self ._possible_lib_locations (cpu )
169
+ log .debug ("looking for libjvm to initiate pyjnius, platform is %s" , platform )
170
+ lib_locations = self ._possible_lib_locations ()
175
171
for location in lib_locations :
176
172
full_lib_location = join (self .home , location )
177
173
if exists (full_lib_location ):
@@ -193,7 +189,7 @@ def get_jnius_lib_location(self):
193
189
% [join (self .home , loc ) for loc in lib_locations ]
194
190
)
195
191
196
- def _possible_lib_locations (self , cpu ):
192
+ def _possible_lib_locations (self ):
197
193
'''
198
194
Returns a list of relative possible locations for the Java library.
199
195
Used by the default implementation of get_jnius_lib_location()
@@ -223,11 +219,16 @@ def _get_platform_include_dir(self):
223
219
else :
224
220
return join (self .home , 'include' , 'linux' )
225
221
226
- def _possible_lib_locations (self , cpu ):
222
+ def _possible_lib_locations (self ):
227
223
root = self .home
228
224
if root .endswith ('jre' ):
229
225
root = root [:- 3 ]
230
226
227
+ cpu = get_cpu ()
228
+ log .debug (
229
+ f"Platform { self .platform } may need cpu in path to find libjvm, which is: { cpu } "
230
+ )
231
+
231
232
return [
232
233
'lib/server/libjvm.so' ,
233
234
'jre/lib/{}/default/libjvm.so' .format (cpu ),
@@ -239,7 +240,7 @@ class MacOsXJavaLocation(UnixJavaLocation):
239
240
def _get_platform_include_dir (self ):
240
241
return join (self .home , 'include' , 'darwin' )
241
242
242
- def _possible_lib_locations (self , cpu ):
243
+ def _possible_lib_locations (self ):
243
244
if '1.6' in self .home :
244
245
return ['../Libraries/libjvm.dylib' ] # TODO what should this be resolved to?
245
246
0 commit comments