withEnv

context(placement: NativePlacement)
inline fun <T> JavaVM.withEnv(version: JniVersion, block: context(JniEnv) () -> T): T(source)

Executes a block of code within the context of a JNI environment of version version of the current thread. If the current thread is not attached to the JavaVM or the specified version is not supported, an exception will be thrown.