M-JVM (current version 1.03)

a KVM written in Java :)

    I had some free time and decided to write a JVM implementation in pure Java :) just for fun, the main part of the work took about three days (those was holidays). Because the JVM (I have named it as M-JVM) has been written in pure Java 1.1, it can be started with any JVM supports Java 1.1 or a major version, thus it can be used from J2ME on a mobile devices (!). You must keep in mind that it is a fun project and you use it for your own risk (but it is an open source project). The M-JVM gives the very good possibility for developers to use pure Java compiled class files as scripts with full control over their execution (as you may be know, J2ME CLDC 1.0 and CLDC 1.1 doesn't support class loaders). Also the M-JVM can be used in listed use cases IMHO:
 - it can emulate the "ClassLoader" mechanism on J2ME based platforms and you can load classes from network on mobile devices and play them (I wrote about it above but it is a good place to repeat it)
 - it can be used to make a virtual platform wrappers and emulate nonexist frameworks (as an example, it is potentially possible to emulate the Android platform frameworks on a standard J2ME device but of course it doesn't support Dalvik VM classes :) )
 - it allows to increase compression ratio because the M-JVM loads classes with an InputStream and you can just glue many classes as one binary file (it allows to the Jar utility to pack them really better) and load them sequentially.
 - many others :)
Remember please that the M-JVM doesn't support both FLOAT and DOUBLE values!!!

 The framework includes three main classes (more detailed information you can find in the JavaDoc for the library):
    The library is distributed under LGPL and the link to load the archive is placed below on this page. The library archive includes sources, JavaDoc and compiled library as a JAR file. As well there are some examples which shows the usage of the library, even a midlet shows flying blocks on a screen (I tried to start the midlet on a real Nokia 6230 and it works well and quickly enough). Of course I understand that the library has been written in a not very optimally way but (as I wrote above) the frst version was written for 3 days :) and it is one of my pet-projects for fun thus I can't spend a lot of time for it.

Download here-> Version 1.03 17-apr-2009

Examples
Hello world! It shows how to write a hello world script and process its calls by a MJVMProcessor mjvm_hello_world.zip
Vector useThe example shows how to work with Vector object from scriptsmjvm_vector_use.zip
SynchroThe example shows ow to work with synchronized methods and objects.mjvm_synchro.zip

Utilities
MJVM Stub GeneratorThis utility allows to generate a java class source which implements the MJVMProcessor interface. The generated class can be used to process calls from a MJVMClass object.mjvmgen_100.zip

 MJVMTestMidlet screenshot


2003-2010 Igor A. Maznitsa. All Rights reserved.