Skip to content

Commit f07f82c

Browse files
fix: JAVA_HOME should be pointing at JDK directory, instead points to JRE directory
1 parent e5354f6 commit f07f82c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ fn do_locate_java_home() -> Result<String> {
195195
// Here we should have found ourselves in a directory like /usr/lib/jvm/java-8-oracle/jre/bin/java
196196
home_path.pop();
197197
home_path.pop();
198+
home_path.pop();
198199

199200
home_path
200201
.into_os_string()
@@ -276,4 +277,10 @@ mod unit_tests {
276277
fn locate_java_from_exec_test() {
277278
println!("do_locate_java_home: {}", do_locate_java_home().unwrap());
278279
}
280+
281+
#[test]
282+
fn jni_headers_test() {
283+
let java_home = do_locate_java_home().unwrap();
284+
assert!(PathBuf::from(java_home).join("include").join("jni.h").exists());
285+
}
279286
}

0 commit comments

Comments
 (0)