Platforms to show: All Mac Windows Linux Cross-Platform

Back to JavaVMMBS class.

Next items

JavaVMMBS.Constructor(path as folderitem)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Initializes the Java virtual machine.

This is a convenience function which initializes the java with version=JNI_VERSION_1_4 and no options except the specified path.
The path can be a folderitem pointing to a jar file or a folder with class files.

This method raises UnsupportedOperationException with error about missing CreateJavaVM function if there is no Java found. Either because it is not installed or the bit number (32 vs. 64) does not match.

Since version 16.5 the plugin will no longer raise exception if an existing JavaVM was found. In that case we use that JavaVM and return normally. Lasterror will be set to -5 which indicates this. In that case your options and paths are not passed to VM.

See also:

JavaVMMBS.Constructor(path as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Initializes the Java virtual machine.

This is a convenience function which initializes the java engine with version=JNI_VERSION_1_4 and no options except the specified path.
The path can be a path pointing to a jar file or a folder with class files. If you use more than one path, you need to separate them with ";". Seems like on Mac OS X and Linux the separator is ":".

This method raises UnsupportedOperationException with error about missing CreateJavaVM function if there is no Java found. Either because it is not installed or the bit number (32 vs. 64) does not match.

Since version 16.5 the plugin will no longer raise exception if an existing JavaVM was found. In that case we use that JavaVM and return normally. Lasterror will be set to -5 which indicates this. In that case your options and paths are not passed to VM.

See also:

JavaVMMBS.Constructor(version as Integer, options() as string, ignoreUnrecognizedOptions as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Initializes the java virtual machine.

Only one VM can run at a time with this plugin.
You can specify whatever command line options you need in the options array.
Version must be one of the JNI_VERSION_1_x constants.

A note for Mac OS X and Java versions:

To specify the current preferred JDK in a family of JVM's, say the 1.5.x family, applications should set the environment variable JAVA_JVM_VERSION to 1.5, and then pass JNI_VERSION_1_4 into JNI_CreateJavaVM as the vm_args.version. To get a specific Java 1.5 JVM, say Java 1.5.0, set the environment variable JAVA_JVM_VERSION to 1.5.0. For Java 1.6 it will be the same in that applications will need to set the environment variable JAVA_JVM_VERSION to 1.6 to specify the current preferred 1.6 Java VM, and to get a specific Java 1.6 JVM, say Java 1.6.1, set the environment variable JAVA_JVM_VERSION to 1.6.1.

To make this sample bring up the current preferred 1.5 JVM, set the environment variable JAVA_JVM_VERSION to 1.5 before calling JNI_CreateJavaVM as shown below. Applications must currently check for availability of JDK 1.5 before requesting it. If your application requires JDK 1.5 and it is not found, it is your responsibility to report an error to the user. To verify if a JVM is installed, check to see if the symlink, or directory exists for the JVM in /System/Library/Frameworks/JavaVM.framework/Versions/ before setting the environment variable JAVA_JVM_VERSION.

If the environment variable JAVA_JVM_VERSION is not set, and JNI_VERSION_1_4 is passed into JNI_CreateJavaVM as the vm_args.version, JNI_CreateJavaVM will return the current preferred JDK. Java 1.4.2 is the preferred JDK as of the release of this sample and the release of Mac OS X 10.4.

Useful option strings:
"-verbose:jni"show debug output on the console
"-Xms256M"initial memory
"-Xmx512M" maximum memory

This method raises UnsupportedOperationException with error about missing CreateJavaVM function if there is no Java found. Either because it is not installed or the bit number (32 vs. 64) does not match.

Since version 16.5 the plugin will no longer raise exception if an existing JavaVM was found. In that case we use that JavaVM and return normally. Lasterror will be set to -5 which indicates this. In that case your options and paths are not passed to VM.

If you get error 126 on Windows, maybe MSVCR100.DLL is missing. So install Visual Studio 2010 runtime libraries. You can download them from Microsoft website. Do not download them from other websites spreading malware!

See also:

JavaVMMBS.Constructor(version as Integer, options() as string, path as folderitem, ignoreUnrecognizedOptions as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Initializes the Java virtual machine.
Example
dim JarPath as folderitem = specialfolder.desktop.child("test.jar")
dim options() as string

options.append "-Xms256M"
options.append "-Xmx512M"

dim v as new JavaVMMBS( JavaVMMBS.JNI_VERSION_1_4, options, JarPath, false)

This is a convenience function which initializes the java engine with adding the given path to the options.

Only one VM can run at a time with this plugin.
You can specify whatever command line options you need in the options array.
Version must be one of the JNI_VERSION_1_x constants.
The path can be a folderitem pointing to a jar file or a folder with class files.

Useful option strings:
"-verbose:jni"show debug output on the console
"-Xms256M"initial memory
"-Xmx512M" maximum memory

This method raises UnsupportedOperationException with error about missing CreateJavaVM function if there is no Java found. Either because it is not installed or the bit number (32 vs. 64) does not match.

Since version 16.5 the plugin will no longer raise exception if an existing JavaVM was found. In that case we use that JavaVM and return normally. Lasterror will be set to -5 which indicates this. In that case your options and paths are not passed to VM.

See also:

JavaVMMBS.Constructor(version as Integer, options() as string, path as string, ignoreUnrecognizedOptions as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Initializes the java virtual machine.

This is a convenience function which initializes the java engine with adding the given path to the options.

Only one VM can run at a time with this plugin.
You can specify whatever command line options you need in the options array.
Version must be one of the JNI_VERSION_1_x constants.
The path can be a path pointing to a jar file or a folder with class files. If you use more than one path, you need to separate them with ";". Seems like on Mac OS X and Linux the separator is ":".

Useful option strings:
"-verbose:jni"show debug output on the console
"-Xms256M"initial memory
"-Xmx512M" maximum memory

This method raises UnsupportedOperationException with error about missing CreateJavaVM function if there is no Java found. Either because it is not installed or the bit number (32 vs. 64) does not match.

Since version 16.5 the plugin will no longer raise exception if an existing JavaVM was found. In that case we use that JavaVM and return normally. Lasterror will be set to -5 which indicates this. In that case your options and paths are not passed to VM.

See also:

JavaVMMBS.DefineClass(name as string, Data as MemoryBlock) as JavaClassMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 20.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Loads a class from a buffer of raw class data.

Returns nil in case of error or valid class object on success.
You may want to load a class file and pass it here as String or MemoryBlock.
To read jar file, you can use our archive classes to expand zip archives.

See also:

JavaVMMBS.DefineClass(name as string, Data as String) as JavaClassMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 20.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Loads a class from a buffer of raw class data.

Returns nil in case of error or valid class object on success.
You may want to load a class file and pass it here as String or MemoryBlock.
To read jar file, you can use our archive classes to expand zip archives.

See also:

JavaVMMBS.FindClass(name as string) as JavaClassMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 4.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Searches a class based on the name.
Example
dim e as JavaVMMBS // global
dim c as JavaClassMBS
c=e.FindClass("java/lang/String")

This function loads a locally defined class. It searches the directories and zip files specified by the CLASSPATH environment variable for the class with the specified name.

name: a fully qualified class name (that is, a package name, delimited by "/", followed by the class name). If the name begins with "[" (the array signature character), it returns an array class.

Returns nil on any error.

If your class is not found, it may be possible that it can't be loaded as the jar archive has dependencies to other jar archives.

Some examples using this method:

JavaVMMBS.FreeCurrentThread

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 8.4 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Releases the thread in Java.
Example
dim w as JavaVMMBS // your vm object
w.FreeCurrentThread

The plugin is written to detect if you use it in a thread. But when the thread ends you need to deregister it with the Java runtime.

Some examples using this method:

JavaVMMBS.FromReflectedField(field as JavaObjectMBS) as JavaFieldMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 4.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Searchs the field which matches the reflected field object.

JavaVMMBS.FromReflectedMethod(method as JavaObjectMBS) as JavaMethodMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 4.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Searchs the method which matches the reflected method object.

JavaVMMBS.IsAssignableFrom(TheSubClass as JavaClassMBS, TheSuperClass as JavaClassMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 4.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
True if the class is assignable from the other class.

That means that the sub class is somewhere down the class tree from the super class.

JavaVMMBS.MonitorEnter(obj as JavaObjectMBS) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 4.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Enters the monitor associated with the underlying Java object referred to by obj.

Returns zero on success; otherwise, returns a negative value on failure.

Each Java objects has a monitor associated with it. If the current thread already owns the monitor associated with ref, it increments a counter in the monitor indicating the number of times this thread has entered the monitor. If the monitor associated with ref is not owned by any thread, the current thread becomes the owner of the monitor, setting the entry count of this monitor to 1. If another thread already owns the monitor associated with ref, the current thread waits until the monitor is released, then tries again to gain ownership.

JavaVMMBS.MonitorExit(obj as JavaObjectMBS) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 4.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Releases the monitor.

The current thread must be the owner of the monitor associated with the underlying Java object referred to by ref. The thread decrements the counter indicating the number of times it has entered this monitor. If as a result the value of the counter becomes zero, the current thread releases the montior.

Returns zero on success; otherwise, returns a negative value on failure.

JavaVMMBS.NewBooleanArray(ref as JavaObjectMBS) as JavaBooleanArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 8.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new array object based on the given java object.

This function is a convenience function to convert a java object array reference to a java array object in Xojo. It can crash if the java object used is not the array of the requested type.

See also:

JavaVMMBS.NewBooleanArray(size as Integer) as JavaBooleanArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 4.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new array for booleans with the given size.

Returns nil on any error.

See also:

JavaVMMBS.NewBooleanArray(values() as Boolean) as JavaBooleanArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates new boolean array with given values.

See also:

JavaVMMBS.NewByteArray(ref as JavaObjectMBS) as JavaByteArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 8.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new array object based on the given java object.

This function is a convenience function to convert a java object array reference to a java array object in Xojo. It can crash if the java object used is not the array of the requested type.

See also:

Some examples using this method:

JavaVMMBS.NewByteArray(size as Integer) as JavaByteArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 4.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new array for bytes with the given size.

Returns nil on any error.

See also:

JavaVMMBS.NewByteArray(values() as UInt8) as JavaBooleanArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates new byte array with given values.

See also:

JavaVMMBS.NewCharArray(ref as JavaObjectMBS) as JavaCharArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 8.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new array object based on the given java object.

This function is a convenience function to convert a java object array reference to a java array object in Xojo. It can crash if the java object used is not the array of the requested type.

See also:

JavaVMMBS.NewCharArray(size as Integer) as JavaCharArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 4.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new array for chars (16bit) with the given size.

Returns nil on any error.

See also:

JavaVMMBS.NewCharArray(values() as UInt16) as JavaCharArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates new char array with given values.

See also:

JavaVMMBS.NewDirectByteBuffer(address as Integer, size as Integer) as JavaObjectMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 4.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new DirectBuffer object based on the values in address and size.

See also:

JavaVMMBS.NewDirectByteBuffer(mem as memoryblock) as JavaObjectMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 4.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new DirectBuffer object based on a memoryblock.

Keep the memoryblock until this object is destroyed.

See also:

JavaVMMBS.NewDoubleArray(ref as JavaObjectMBS) as JavaDoubleArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 8.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new array object based on the given java object.

This function is a convenience function to convert a java object array reference to a java array object in Xojo. It can crash if the java object used is not the array of the requested type.

See also:

JavaVMMBS.NewDoubleArray(size as Integer) as JavaDoubleArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 4.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new array for doubles with the given size.

Returns nil on any error.

See also:

JavaVMMBS.NewDoubleArray(values() as Double) as JavaDoubleArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates new double array with given values.

See also:

JavaVMMBS.NewFloatArray(ref as JavaObjectMBS) as JavaFloatArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 8.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new array object based on the given java object.

This function is a convenience function to convert a java object array reference to a java array object in Xojo. It can crash if the java object used is not the array of the requested type.

See also:

JavaVMMBS.NewFloatArray(size as Integer) as JavaFloatArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 4.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new array for singles with the given size.

Returns nil on any error.

See also:

JavaVMMBS.NewFloatArray(values() as Single) as JavaFloatArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates new float array with given values.

See also:

JavaVMMBS.NewIntArray(ref as JavaObjectMBS) as JavaIntArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 8.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new array object based on the given java object.

This function is a convenience function to convert a java object array reference to a java array object in Xojo. It can crash if the java object used is not the array of the requested type.

See also:

JavaVMMBS.NewIntArray(size as Integer) as JavaIntArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 4.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new array for integers with the given size.

Returns nil on any error.

See also:

JavaVMMBS.NewIntArray(values() as Int32) as JavaIntArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates new Int32 array with given values.

See also:

JavaVMMBS.NewLongArray(ref as JavaObjectMBS) as JavaLongArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 8.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new array object based on the given java object.

This function is a convenience function to convert a java object array reference to a java array object in Xojo. It can crash if the java object used is not the array of the requested type.

See also:

JavaVMMBS.NewLongArray(size as Integer) as JavaLongArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 4.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new array for 64 bit integers with the given size.

Returns nil on any error.

See also:

JavaVMMBS.NewLongArray(values() as Int64) as JavaLongArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates new Int64 array with given values.

See also:

JavaVMMBS.NewObjectArray(ref as JavaObjectMBS) as JavaObjectArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 8.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new array object based on the given java object.

This function is a convenience function to convert a java object array reference to a java array object in Xojo. It can crash if the java object used is not the array of the requested type.

See also:

Some examples using this method:

JavaVMMBS.NewObjectArray(size as Integer, TheClass as JavaClassMBS, InitialValue as JavaObjectMBS = nil) as JavaObjectArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 4.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Constructs a new array holding objects in class elementClass.

All elements are initially set to initialElement.
Returns nil on any error.

See also:

JavaVMMBS.NewObjectArray(values() as JavaObjectMBS) as JavaObjectArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new Java object array with given size.

See also:

JavaVMMBS.NewShortArray(ref as JavaObjectMBS) as JavaShortArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 8.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new array object based on the given java object.

This function is a convenience function to convert a java object array reference to a java array object in Xojo. It can crash if the java object used is not the array of the requested type.

See also:

JavaVMMBS.NewShortArray(size as Integer) as JavaShortArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 4.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new array for shorts with the given size.

Returns nil on any error.

See also:

JavaVMMBS.NewShortArray(values() as Int16) as JavaShortArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates new short array with given values.

See also:

JavaVMMBS.NewStringArray(size as integer, InitialValue as JavaStringMBS = nil) as JavaObjectArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new Java string array with given size.

See also:

JavaVMMBS.NewStringArray(values() as String) as JavaObjectArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates new string array with given values.

See also:

JavaVMMBS.NewStringUnicode(s as string) as JavaStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 4.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new string.

Preferres an Unicode encoded string.

JavaVMMBS.NewStringUTF8(s as string) as JavaStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 4.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Creates a new string.
Example

// init Java
dim options() as string
dim javaVm as new JavaVMMBS(JavaVMMBS.JNI_VERSION_1_4, options, true)

// Get system class
Dim system As JavaClassMBS = javaVm.FindClass("java/lang/System")

If system <> Nil Then

// query method
dim transfomerGetPropertyId as JavaMethodMBS = system.GetStaticMethod("getProperty", "(Ljava/lang/String;)Ljava/lang/String;")
If transfomerGetPropertyId <> Nil Then

// make parameters
Dim keyString As JavaStringMBS = javaVm.NewStringUTF8("os.version")
dim m as New MemoryBlock(8)
m.Int64Value(0)=keyString.Handle

// run it
dim r as JavaObjectMBS = system.CallStaticObjectMethod(transfomerGetPropertyId, m)

if r<>Nil then
// show result
dim s as JavaStringMBS = JavaStringMBS(r)
MsgBox s.CopyStringUTF
end if

End If
End If

Preferres an UTF8 encoded string.

Some examples using this method:

JavaVMMBS.Runtime as JavaRuntimeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Java MBS Java Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Returns the runtime object for the current VM so you can query the memory statistics.

Some examples using this method:

Next items

The items on this page are in the following plugins: MBS Java Plugin.


The biggest plugin in space...