New features / 新增功能
- IJvmInvoker.DefineClass: Define a Java class directly from bytecode (equivalent to JNI
DefineClass). Useful for ASM-generated bridge classes that need to be loaded without writing to disk. - IJvmInvoker.NewGlobalRef / DeleteGlobalRef: Promote JNI local references to global references, so Java objects returned by
InvokeStatic/InvokeVirtual/NewObjectcan be held across JNI frames (e.g. stored in static fields for later callbacks).
.NET 10 compatibility / .NET 10 兼容性修复
JdkRuntimeBasenow registers aDllImportResolverso[DllImport("jvm")]resolves to the runtime-loadedjvm.dll— avoids the .NET 10 P/Invoke thunk crash ondelegate* unmanaged/Marshal.GetDelegateForFunctionPointer.CreateJavaVmcallsJNI_CreateJavaVMvia unsafe pointers (delegate* unmanaged[Cdecl]), bypassing .NET 10 marshalling issues onout/ref IntPtrparameters.NativeMethods.GetCreateJavaVMPtrreturns the unmanaged function pointer directly.- New
Interop/PInvoke.csdeclares the unsafe P/Invoke entry point.
Full Changelog: v2.1.0...v2.2.0