JamaicaVM -- User Documentation: The Virtual Machine for Real-time and Embedded Systems | ||
---|---|---|
Prev | Chapter 3. Jamaica Builder | Next |
To illustrate the Builder, a rather simple example Figure 3-1 is build:
After compilation of this class using a Java-to-Bytecode compiler, e. g. javac, it can already be executed using the JamaicaVM as follows
> jamaicavm HelloWorld Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! ... |
During execution, the class file HelloWorld.class and several system classes like String.class are loaded by JamaicaVM from the directories specified in the current CLASSPATH.
A standalone application can be created with the Builder:
> jamaica HelloWorld Jamaica Builder Tool 2.2 Release 1 Generating code for target 'linux-gnu-i686' + HelloWorld__.c * C compiling * linking * stripping Class file compaction gain: 59.02125% (1722798 ==> 705981) > |
A created application contains all the classes required for execution. The application can be started like any other program by its name. Additional arguments and parameters can be passed on the command line. They will passed to the application main method in the string-array parameter. The general format to execute an application is:
<application name> [<argument 1> [<argument 2> ...]] |
The HelloWorld executable can be executed directly with:
> ./HelloWorld Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! ... |