File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ def _silent_check_output(*args, **kwargs):
4747 try :
4848 with patch .object (subprocess , "check_output" , new = _silent_check_output ):
4949 jpype .getDefaultJVMPath ()
50- # on Darwin, may raise a CalledProcessError when invoking `/user /libexec/java_home`
50+ # on Darwin, may raise a CalledProcessError when invoking `/usr /libexec/java_home`
5151 except (jpype .JVMNotFoundException , subprocess .CalledProcessError ):
5252 return False
5353 return True
Original file line number Diff line number Diff line change @@ -70,8 +70,14 @@ def jvm_version() -> tuple[int, ...]:
7070 default_jvm_path = jpype .getDefaultJVMPath ()
7171 if not default_jvm_path :
7272 raise RuntimeError ("Cannot glean the default JVM path" )
73+ print (f"Default JVM path from JPype: { default_jvm_path } " )
7374
74- p = Path (default_jvm_path )
75+ # Good ol' macOS! Nothing beats macOS.
76+ jvm_path = default_jvm_path .replace (
77+ "/Contents/MacOS/libjli.dylib" , "/Contents/Home/lib/libjli.dylib"
78+ )
79+
80+ p = Path (jvm_path )
7581 if not p .exists ():
7682 raise RuntimeError (f"Invalid default JVM path: { p } " )
7783
Original file line number Diff line number Diff line change 1010
1111before_version = scyjava .jvm_version ()
1212assert_that (before_version ).is_not_none ()
13- assert_that (len (before_version )).is_greater_than_or_equal_to (3 )
13+ assert_that (len (before_version )).is_greater_than_or_equal_to (1 )
1414assert_that (before_version [0 ]).is_greater_than (0 )
1515
1616scyjava .config .enable_headless_mode ()
1717scyjava .start_jvm ()
1818
1919after_version = scyjava .jvm_version ()
2020assert_that (after_version ).is_not_none ()
21- assert_that (len (after_version )).is_greater_than_or_equal_to (3 )
21+ assert_that (len (after_version )).is_greater_than_or_equal_to (1 )
2222assert_that (after_version [0 ]).is_greater_than (0 )
2323
2424assert_that (before_version ).is_equal_to (after_version )
You can’t perform that action at this time.
0 commit comments