Building a CLDC Reference Port (MR1)

first | prev | next | last

CLDC software is an OSS community version of Sun Microsystems' Connected Limited Device Configuration HotSpot™ Implementation virtual machine. Although primarily created from the same shared code base, Sun Microsystems' commercial product might not fully and accurately represent the OSS source base, due to licensing and other legal restrictions.

This document has the following sections:

For more information about CLDC, see CLDC HotSpot Implementation software documentation.


CLDC Build Environment

This chapter provides basic instructions for building the CLDC software, which is needed to build the phoneME Feature software. Many CLDC software build configurations and options are possible. This guide describes how to build a default implementation only.

Setting Variables for a Linux Platform

Note: This document assumes the use of the Bash shell on the Linux platform. If you are using some other shell, set the variables for the shell you are using.

To properly build CLDC software on a Linux build platform, you must set the environment variables shown in TABLE 4-1. For more information on setting other Linux build environment variables, see Setting Up the Linux Build Environment.

Once the variables in TABLE 4-1 are set, no other Linux build environment set up is needed.

TABLE 4-1 Linux Platform Environment Variables

Name

Description

JVMWorkSpace

The location of your CLDC software source code workspace.

JVMBuildSpace

The location of your CLDC software build output.

CLDC_DIST_DIR

Required for building phoneME Feature software. Must point to the location of CLDC software build output. For example: CLDC_DIST_DIR=$JVMBuildSpace/linux_arm/dist

PATH

Must be set to include all gnumake and compiler tools used in the build process.

ENABLE_PCSL

Required for building the phoneME Feature software. Must be set to true.

ENABLE_ISOLATES

Required for using multitasking functionality. Must be set to true.

For example, to set the variable JVMWorkSpace as a system variable, enter this command:

$ export JVMWorksSpace=/development/openvm/linux

To set JVMWorkSpace on a make command line, enter this command:

$ make JVMWorkSpace=/development/openvm/linux

Setting Variables for a Windows Platform

Note: This document assumes the use of Cyg4Me on the Windows platform.

To properly build the CLDC software on a Windows platform, you must set the environment variables shown in TABLE 4-2. For more information on setting other Windows build environment variables, see Setting Up the Windows Build Environment.

Once the variables shown in TABLE 4-2 are set, no other build environment setup is needed.

TABLE 4-2 Windows Platform Environment Variables

Name

Description

JVMWorkSpace

The location of your CLDC software source code workspace.

JVMBuildSpace

The location of your CLDC software build output.

CLDC_DIST_DIR

Required for building phoneME Feature software. Must point to the location of CLDC software build output. For example: CLDC_DIST_DIR=$JVMBuildSpace/win32_i386/dist

PATH

Must be set to include all gnumake and compiler tools used in the build process.

INCLUDE

Points to the include directory inside your MSVC++ installation.

LIB

Points to the lib directory inside your MSVC++ installation.

X86_PATH

Set it to the same value as your PATH variable.

X86_INCLUDE

Set it to the same value as your INCLUDE variable.

X86_LIB

Set it to the same value as your LIB variable.

ENABLE_PCSL

Required for building the phoneME Feature software. Must be set to true.

ENABLE_ISOLATES

Required for using multitasking functionality. Must be set to true.

For example, to set JVMWorkSpace as a system variable, enter this command:

$ set JVMWorkSpace=C:/development/openvm/win32

To set JVMWorkSpace on a gnumake command line, enter this command:

$ make JVMWorkSpace=C:/development/openvm/win32


Building CLDC Software

The default CLDC software build mode is Debug. Building a default version of the CLDC software creates a debuggable version of the CLDC software executable (cldc_vm_g on Linux and cldc_vm_g.exe on Windows). The debug build version executes relatively slowly, but is valuable for testing and debugging the system.

After building the CLDC system, follow the instructions in Running CLDC Software to run it.

Building CLDC for a Linux Platform

Note: This document assumes the use of the Bash shell on the Linux platform. If you are using some other shell, set the variables for the shell you are using.

  1. Ensure that you have set the required environment variables.
  2. For more information, see Setting Variables for a Linux Platform.

  3. Change directory to $JVMWorkSpace/build/linux_arm and run the make command.

    $ make debug

    Output is generated under $JVMBuildSpace/linux_arm/target/bin

Building CLDC for a Windows Platform

Note: This document assumes the use of Cyg4Me on the Windows platform.

  1. Ensure that you have set the required environment variables.
  2. For more information, see Setting Variables for a Windows Platform.

  3. Change directory to %JVMWorkSpace%/build/win32_i386 and run the make command.

    $ make debug

    Output is generated under %JVMBuildSpace%/build/win32_i386/target/bin.


Building CLDC Documentation

You can create HTML documents from CLDC porting interfaces. To do this for the CLDC software, use the make docs_html build target.

Generating Javadoc Tool Documentation

Building Javadoc™ tool documentation is the same for both Linux and Windows platforms.

  1. Change to the default build directory for your target platform.
  2. $ cd $JVMWorkSpace/build/platform

  3. Build Javadoc tool HTML documentation.
  4. $ make docs_html

    The generated HTML documents are put in the following directory:

    $JVMBuildSpace/doc/javadoc/html

Viewing phoneME Feature Documents

Use any browser to display the Javadoc tool output file at the following URL:

file:///$JVMBuildSpace/doc/javadoc/html/index.html


Running CLDC Software

Once you build a debug version of CLDC, you can invoke it from the command line to run a class compiled from the Java programming language. The path to the executable depends on the target platform (operating system and processor) for which you build the software.

Note: Many more command options are available to run the CLDC software, on both Linux and Windows platforms, than shown here. For more information, see CLDC HotSpot Implementation Build Guide.

Running CLDC on a Linux Platform

  1. Change to the CLDC build space for the Linux/ARM platform:
  2. $ cd $JVMBuildSpace/linux_arm

  3. Enter the following command:
  4. $ bin/cldc_vm_g -classpath location-of-compiled-applications/classes classname

Running CLDC on a Windows Platform

  1. Change to the CLDC build space for the Win32/i386 platform:
  2. $ cd %JVMBuildSpace%/win32/i386

  3. Enter the following command:
  4. $ bin/cldc_vm_g.exe -classpath location-of-compiled-applications/classes classname

first | prev | next | last