MBS Xojo Developer Conference and Training
Join us from 3rd to 6th May 2017 in Berlin, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

JavaVMMBS class

class, Java, MBS Java Plugin (Java), class JavaVMMBS,
Plugin version: 4.3, Mac: Yes, Win: Yes, Linux: Yes, Console & Web: Yes, Feedback.

Function: The class for a java virtual machine.
Example:
dim vm as JavaVMMBS // global

const JNI_VERSION_1_1 = &h00010001
const JNI_VERSION_1_2 = &h00010002
const JNI_VERSION_1_4 = &h00010004

if TargetLinux then
// change path for your linux PC!
JavaVMMBS.SetLibraryPath("/home/cs/jre1.6.0_05/lib/i386/client/libjvm.so")
end if

dim options(-1) as string
dim f as FolderItem=GetFolderItem("test.jar")

vm=new JavaVMMBS(JNI_VERSION_1_4, options, f, false)

if vm.Handle = 0 then
MsgBox "Can't create Java VM"
else
MsgBox "Java Initialized."
end if
Notes:
Add Linux support plugin version 8.7.

Releasing the java vm (by releasing all java objects), and reinitializing can fail.

Please make sure this Java VM object stays alive until you are done with all your java stuff. So all the java objects go away and this vm object is destroyed on the end. Because if some java code is still running like an background java thread, quitting the VM can lead into crashes.

While the plugin supports to have several instances, it seems like JNI does not support that.

This class has no sub classes.

Some methods using this class:

Some properties using for this class:

Some examples which use this class:


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


JavaThrowableMBS   -   JPEG2000MBS




Links
MBS Xojo tutorial videos