Skip to content

v2.2.0

Latest

Choose a tag to compare

@XSY-HYH XSY-HYH released this 17 Jul 00:11

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 / NewObject can be held across JNI frames (e.g. stored in static fields for later callbacks).

.NET 10 compatibility / .NET 10 兼容性修复

  • JdkRuntimeBase now registers a DllImportResolver so [DllImport("jvm")] resolves to the runtime-loaded jvm.dll — avoids the .NET 10 P/Invoke thunk crash on delegate* unmanaged / Marshal.GetDelegateForFunctionPointer.
  • CreateJavaVm calls JNI_CreateJavaVM via unsafe pointers (delegate* unmanaged[Cdecl]), bypassing .NET 10 marshalling issues on out/ref IntPtr parameters.
  • NativeMethods.GetCreateJavaVMPtr returns the unmanaged function pointer directly.
  • New Interop/PInvoke.cs declares the unsafe P/Invoke entry point.

Full Changelog: v2.1.0...v2.2.0