Core Assembly | Main Assembly |
---|---|
Rxmxnx.JNetInterface
provides an implementation of the Java Native Interface (JNI) and the Invocation API for .NET
applications.
Rxmxnx.JNetInterface.Core
: Provides essential types and abstractions to work with JNI without requiring an actual JVM instance.- Unit Testing Support: The
Rxmxnx.JNetInterface.Proxies
namespace includes types that enable unit testing without a JVM.
Note: Some features may not be available in Visual Basic .NET and may require additional configuration in F#.
Install via NuGet:
dotnet add package Rxmxnx.JNetInterface
If you only need the core functionality without linking to a JVM, install:
dotnet add package Rxmxnx.JNetInterface.Core
Supported Frameworks:
This package supports .NET 8 and higher. Ensure your project targets a compatible framework.
Rxmxnx.JNetInterface
provides safe, high-level APIs to interact with JNI and the JVM.
The table below shows how common JNI types map to Rxmxnx.JNetInterface
.
Java Type | JNI Type | Managed Type | Unmanaged Type |
---|---|---|---|
boolean | jboolean | IWrapper<System.Boolean> | JBoolean |
byte | jbyte | IWrapper<System.SByte> | JByte |
char | jchar | IWrapper<System.Char> | JChar |
double | jdouble | IWrapper<System.Double> | JDouble |
float | jfloat | IWrapper<System.Single> | JFloat |
int | jint | IWrapper<System.Int32> | JInt |
long | jlong | IWrapper<System.Int64> | JLong |
short | jshort | IWrapper<System.Int16> | JShort |
java.lang.Object | jobject | JLocalObject | JLocalRef |
java.lang.Class<?> | jclass | JClassObject 2 | JClassLocalRef |
java.lang.String | jstring | JStringObject | JStringLocalRef |
java.lang.Throwable | jthrowable | JThrowableObject | JThrowableLocalRef |
[] | jarray | JArrayObject | JArrayLocalRef |
boolean[] | jbooleanArray | JArrayObject<JBoolean> | JBooleanArrayLocalRef |
byte[] | jbyteArray | JArrayObject<JByte> | JByteArrayLocalRef |
char[] | jcharArray | JArrayObject<JChar> | JCharArrayLocalRef |
double[] | jdoubleArray | JArrayObject<JDouble> | JDoubleArrayLocalRef |
float[] | jfloatArray | JArrayObject<JFloat> | JFloatArrayLocalRef |
int[] | jintArray | JArrayObject<JInt> | JIntArrayLocalRef |
long[] | jlongArray | JArrayObject<JLong> | JLongArrayLocalRef |
short[] | jshortArray | JArrayObject<JShort> | JShortArrayLocalRef |
T[] | jobjectArray | JArrayObject<T> | JObjectArrayLocalRef |
N/A | JavaVM* | IVirtualMachine 1 | JVirtualMachineRef |
N/A | JNIEnv* | IEnvironment 1 | JEnvironmentRef |
N/A | jglobal | JGlobal 2 | JGlobalRef |
N/A | jweak | JWeak | JWeakRef |
N/A | jmethodID | JCallDefinition 3 | JMethodId |
N/A | jfieldID | JFieldDefinition 3 | JFieldId |
- When initialized via the Invocation API,
IInvokedVirtualMachine
is used. When a thread is attached to the JVM,IThread
is used. JClassObject
andJGlobal
references to classes may not have active JNI references and are loaded as needed.- Definitions serve as keys for JNI access calls.