Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

Next items

JavaVMMBS.Constructor(path as folderitem)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 8.5 Yes Yes Yes Yes No
Function: Initializes the Java virtual machine.
Notes:
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:

Feedback, Comments & Corrections

JavaVMMBS.Constructor(path as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 8.5 Yes Yes Yes Yes No
Function: Initializes the Java virtual machine.
Notes:
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:

Feedback, Comments & Corrections

JavaVMMBS.Constructor(version as Integer, options() as string, ignoreUnrecognizedOptions as boolean)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 8.5 Yes Yes Yes Yes No
Function: Initializes the java virtual machine.
Notes:
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.

See also:

Feedback, Comments & Corrections

JavaVMMBS.Constructor(version as Integer, options() as string, path as folderitem, ignoreUnrecognizedOptions as boolean)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 8.5 Yes Yes Yes Yes No
Function: 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)
Notes:
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:

Feedback, Comments & Corrections

JavaVMMBS.Constructor(version as Integer, options() as string, path as string, ignoreUnrecognizedOptions as boolean)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 8.5 Yes Yes Yes Yes No
Function: Initializes the java virtual machine.
Notes:
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:

Feedback, Comments & Corrections

JavaVMMBS.FindClass(name as string) as JavaClassMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Searches a class based on the name.
Example:
dim e as JavaVMMBS // global
dim c as JavaClassMBS
c=e.FindClass("java/lang/String")
Notes:
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.

Feedback, Comments & Corrections

JavaVMMBS.FreeCurrentThread
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 8.4 Yes Yes Yes Yes No
Function: Releases the thread in Java.
Example:
dim w as JavaVMMBS // your vm object
w.FreeCurrentThread
Notes: 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.

Feedback, Comments & Corrections

JavaVMMBS.FromReflectedField(field as JavaObjectMBS) as JavaFieldMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Searchs the field which matches the reflected field object.

Feedback, Comments & Corrections

JavaVMMBS.FromReflectedMethod(method as JavaObjectMBS) as JavaMethodMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Searchs the method which matches the reflected method object.

Feedback, Comments & Corrections

JavaVMMBS.IsAssignableFrom(TheSubClass as JavaClassMBS, TheSuperClass as JavaClassMBS) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: True if the class is assignable from the other class.
Notes: That means that the sub class is somewhere down the class tree from the super class.

Feedback, Comments & Corrections

JavaVMMBS.MonitorEnter(obj as JavaObjectMBS) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Enters the monitor associated with the underlying Java object referred to by obj.
Notes:
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.

Feedback, Comments & Corrections

JavaVMMBS.MonitorExit(obj as JavaObjectMBS) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Releases the monitor.
Notes:
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.

Feedback, Comments & Corrections

JavaVMMBS.NewBooleanArray(ref as JavaObjectMBS) as JavaBooleanArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 8.3 Yes Yes Yes Yes No
Function: Creates a new array object based on the given java object.
Notes: This function is a convenience function to convert a java object array reference to a java array object in REALbasic. It can crash if the java object used is not the array of the requested type.

See also:

Feedback, Comments & Corrections

JavaVMMBS.NewBooleanArray(size as Integer) as JavaBooleanArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Creates a new array for booleans with the given size.
Notes: Returns nil on any error.

See also:

Feedback, Comments & Corrections

JavaVMMBS.NewByteArray(ref as JavaObjectMBS) as JavaByteArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 8.3 Yes Yes Yes Yes No
Function: Creates a new array object based on the given java object.
Notes: This function is a convenience function to convert a java object array reference to a java array object in REALbasic. It can crash if the java object used is not the array of the requested type.

See also:

Feedback, Comments & Corrections

JavaVMMBS.NewByteArray(size as Integer) as JavaByteArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Creates a new array for bytes with the given size.
Notes: Returns nil on any error.

See also:

Feedback, Comments & Corrections

JavaVMMBS.NewCharArray(ref as JavaObjectMBS) as JavaCharArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 8.3 Yes Yes Yes Yes No
Function: Creates a new array object based on the given java object.
Notes: This function is a convenience function to convert a java object array reference to a java array object in REALbasic. It can crash if the java object used is not the array of the requested type.

See also:

Feedback, Comments & Corrections

JavaVMMBS.NewCharArray(size as Integer) as JavaCharArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Creates a new array for chars (16bit) with the given size.
Notes: Returns nil on any error.

See also:

Feedback, Comments & Corrections

JavaVMMBS.NewDirectByteBuffer(address as Integer, size as Integer) as JavaObjectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Creates a new DirectBuffer object based on the values in address and size.

See also:

Feedback, Comments & Corrections

JavaVMMBS.NewDirectByteBuffer(mem as memoryblock) as JavaObjectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Creates a new DirectBuffer object based on a memoryblock.
Notes: Keep the memoryblock until this object is destroyed.

See also:

Feedback, Comments & Corrections

JavaVMMBS.NewDoubleArray(ref as JavaObjectMBS) as JavaDoubleArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 8.3 Yes Yes Yes Yes No
Function: Creates a new array object based on the given java object.
Notes: This function is a convenience function to convert a java object array reference to a java array object in REALbasic. It can crash if the java object used is not the array of the requested type.

See also:

Feedback, Comments & Corrections

JavaVMMBS.NewDoubleArray(size as Integer) as JavaDoubleArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Creates a new array for doubles with the given size.
Notes: Returns nil on any error.

See also:

Feedback, Comments & Corrections

JavaVMMBS.NewFloatArray(ref as JavaObjectMBS) as JavaFloatArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 8.3 Yes Yes Yes Yes No
Function: Creates a new array object based on the given java object.
Notes: This function is a convenience function to convert a java object array reference to a java array object in REALbasic. It can crash if the java object used is not the array of the requested type.

See also:

Feedback, Comments & Corrections

JavaVMMBS.NewFloatArray(size as Integer) as JavaFloatArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Creates a new array for singles with the given size.
Notes: Returns nil on any error.

See also:

Feedback, Comments & Corrections

JavaVMMBS.NewIntArray(ref as JavaObjectMBS) as JavaIntArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 8.3 Yes Yes Yes Yes No
Function: Creates a new array object based on the given java object.
Notes: This function is a convenience function to convert a java object array reference to a java array object in REALbasic. It can crash if the java object used is not the array of the requested type.

See also:

Feedback, Comments & Corrections

JavaVMMBS.NewIntArray(size as Integer) as JavaIntArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Creates a new array for integers with the given size.
Notes: Returns nil on any error.

See also:

Feedback, Comments & Corrections

JavaVMMBS.NewLongArray(ref as JavaObjectMBS) as JavaLongArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 8.3 Yes Yes Yes Yes No
Function: Creates a new array object based on the given java object.
Notes: This function is a convenience function to convert a java object array reference to a java array object in REALbasic. It can crash if the java object used is not the array of the requested type.

See also:

Feedback, Comments & Corrections

JavaVMMBS.NewLongArray(size as Integer) as JavaLongArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Creates a new array for 64 bit integers with the given size.
Notes: Returns nil on any error.

See also:

Feedback, Comments & Corrections

JavaVMMBS.NewObjectArray(ref as JavaObjectMBS) as JavaObjectArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 8.3 Yes Yes Yes Yes No
Function: Creates a new array object based on the given java object.
Notes: This function is a convenience function to convert a java object array reference to a java array object in REALbasic. It can crash if the java object used is not the array of the requested type.

See also:

Feedback, Comments & Corrections

Next items

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




Links
MBS Xojo Plugins