Skip to content

Commit

Permalink
paquo.jpype_backend: set java.library.path to appdir
Browse files Browse the repository at this point in the history
This adds java.library.path = {qupath_app_dir} to the jvm options:
- allows openslide to be used by qupath java libraries
- improves add_image speed for tif-files

Partially reverts: d7df792
Relates to: #20
  • Loading branch information
ap-- committed Aug 5, 2020
1 parent 6718f2a commit 537ab07
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions paquo/jpype_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ def qupath_jvm_info_from_qupath_dir(qupath_dir: Path, jvm_options: List[str]) ->
if not (app_dir.is_dir() and runtime_dir.is_dir() and jvm_dir.is_file()):
raise FileNotFoundError('qupath installation is incompatible')

# note: jvm_options is just passed through
# but this is the best place to have os-specific jvm_options modifications
# in case it's needed at some point
# Add java.library.path so that the qupath provided openslide works
jvm_options.append(f"-Djava.library.path={app_dir}")
jvm_options = list(dict.fromkeys(jvm_options)) # keep options unique and in order

return app_dir, runtime_dir, jvm_dir, jvm_options


Expand Down

0 comments on commit 537ab07

Please sign in to comment.