findJavaHome function

String? findJavaHome({
  1. Map<String, String>? environment,
})

The JDK home of the libjvm that searchLibjvm finds, or null.

The same search, in the same order, so every tool — the binding, a build script, a code generator — agrees on which JDK is in use.

Implementation

String? findJavaHome({Map<String, String>? environment}) {
  final libjvm = searchLibjvm(environment: environment).resolved;
  return libjvm == null ? null : javaHomeOf(libjvm);
}