On Tue, 26 May 2026 21:48:27 GMT, Marius Hanl <[email protected]> wrote:
> There are a few locations where we have the following pattern;
>
> ```
> if (jvm->GetEnv((void **)&env, JNI_VERSION_1_8)) {
> return JNI_ERR; /* JNI version not supported */
> }
> ```
>
> which should not happen anymore, right? Most of the code locations do not
> have this check and just do:
>
> ```
> jvm->GetEnv(&env, JNI_VERSION_1_8);
> ```
>
> Should I follow that pattern for the few locations left?
When `GetEnv()` fails, it is documented to return either `JNI_EDETACHED` when
called from a non-JVM thread, or `JNI_EVERSION` when the version is not
supported. I think we can safely rule out both cases: it's impossible for
JavaFX to run on a non-JVM thread, and it is also impossible for JavaFX to run
on a JVM < 8.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/2175#issuecomment-4592655150