- various fixes

This commit is contained in:
w.pomp
2026-08-07 15:14:16 +02:00
parent e4de76f26c
commit a0d2359e55
13 changed files with 191 additions and 97 deletions
+13 -6
View File
@@ -5,10 +5,9 @@ use serde::{Deserialize, Serialize};
use std::fmt::Debug;
use std::path::{Path, PathBuf};
pub use crate::readers::{ArrayT, PixelType, Reader};
use crate::readers::{DynReader, Frame, Shape};
use crate::readers::{ArrayT, DynReader, Frame, PixelType, Reader, Shape};
use itertools::Itertools;
use j4rs::{Instance, InvocationArg, Jvm, JvmBuilder};
use j4rs::{Instance, InvocationArg, JavaOpt, Jvm, JvmBuilder};
use std::cell::OnceCell;
use std::collections::HashSet;
use std::hash::{Hash, Hasher};
@@ -109,8 +108,16 @@ fn jvm() -> Rc<Jvm> {
let j = JvmBuilder::new()
.skip_setting_native_lib()
.with_base_path(class_path.to_str().unwrap())
.build()
.expect("Failed to build JVM");
.java_opt(JavaOpt::new("--enable-native-access=ALL-UNNAMED"))
.build();
let j = match j {
Ok(j) => j,
Err(_) => JvmBuilder::new()
.skip_setting_native_lib()
.with_base_path(class_path.to_str().unwrap())
.build()
.expect("Failed to build JVM"),
};
if let Ok(e) = InvocationArg::try_from("ERROR") {
let _ = j.invoke_static(
"loci.common.DebugTools",
@@ -122,7 +129,7 @@ fn jvm() -> Rc<Jvm> {
})
}
})
.clone()
.clone()
})
}