Building a CLDC Reference Port (MR2)

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 building and running CLDC, see CLDC HotSpot Implementation software documentation.


Building CLDC Software on a Linux on i386 Build Platform

This section describes how to build a default implementation of the CLDC software. A successful build of CLDC is required to build the phoneME Feature software client.

Setting Variables for a Linux on i386 Build Platform

Building a default version of the CLDC software creates the executable cldc_vm, for both Linux on i386 and Linux on ARM target platforms. To properly build CLDC software on a Linux on i386 build platform, you must set the environment variables shown in TABLE 4-1.

TABLE 4-1Required CLDC Build Variables for Linux on i386

Name

Description

JVMWorkSpace

The location of your CLDC software source code directory. For example, JVMWorkSpace=$MEHOME/cldc.

JVMBuildSpace

The location of your CLDC software build output. For example, JVMBuildSpace=$BUILD_OUTPUT_DIR/cldc.

ENABLE_PCSL

Required for building CLDC with the PCSL software component. Must be set to true.

PCSL_OUTPUT_DIR

The location of PCSL build output. Required for building CLDC if ENABLE_PCSL=true. For example, PCSL_OUTPUT_DIR=$BUILD_OUTPUT_DIR/pcsl.

ENABLE_ISOLATES

Required for building a CLDC implementation with multitasking capability. Must be set to true. If not explicitly set to true, the build defaults to false and CLDC is built without multitasking capability.

Setting Build Environment Variables for Both Target Platforms

The primary CLDC environment variables, $JVMWorkSpace and $JVMBuildSpace, are set once, as system variables, for both Linux on i386 and Linux on ARM target platforms. To set these variables, take the following steps:

  1. Set the JVMWorkSpace variable, as shown here.

    $ export JVMWorkSpace=$MEHOME/cldc

  2. Set the JVMBuildSpace variable, as shown here.

    $ export JVMBuildSpace=$BUILD_OUTPUT_DIR/cldc

Building CLDC for a Linux on i386 Target Platform

To build CLDC for the Linux on i386 target platform, take the following steps.

  1. Change to the CLDC build directory, as shown here.

    $ cd $JVMWorkSpace/build/linux_i386

    Note: You can skip this step and use the make -C build option. For more information, see Building with the make -C Option.

  2. Run the make command as a single command-line string, as shown here.

    $ make ENABLE_PCSL=true PCSL_OUTPUT_DIR=$BUILD_OUTPUT_DIR/pcsl ENABLE_ISOLATES=true

The generated CLDC output is found under $JVMBuildSpace/linux_i386/dist.

Building CLDC for a Linux/ARM Target Platform

To build CLDC for the Linux on ARM target platform, take the following steps.

  1. Change to the CLDC build directory, as shown here.

    $ cd $JVMWorkSpace/build/linux_arm

    Note: You can skip this step and use the make -C build option. For more information, see Building with the make -C Option.

  2. Run the make command as a single command-line string, as shown here.

    $ make ENABLE_PCSL=true PCSL_OUTPUT_DIR=$BUILD_OUTPUT_DIR/pcsl ENABLE_ISOLATES=true GNU_TOOLS_DIR=$MONTAVISTA

    Note: In this command line, the variable $MONTAVISTA is a shortcut for a much longer command string, as described here.

The generated CLDC output is found under $JVMBuildSpace/linux_arm/dist.


Building CLDC Software on a Win32 on i386 Build Platform

Building a default version of CLDC creates the CLDC software executable cldc_vm.exe for the JavaCall porting layer on i386 target platform. To properly build the CLDC software on a Win32 on i386 build platform, you must set the environment variables shown in TABLE 4-2.

TABLE 4-2Required CLDC Build Variables for Win32 on i386

Name

Description

JVMWorkSpace

The location of your CLDC software source code workspace. For example, JVMWorkSpace=%MEHOME%/cldc.

JVMBuildSpace

The location of your CLDC software build output. For example, JVMBuildSpace=%BUILD_OUTPUT_DIR%/cldc.

ENABLE_PCSL

Required for building CLDC with the PCSL software component. Must be set to true.

PCSL_OUTPUT_DIR

The location of PCSL build output. Required for building CLDC if ENABLE_PCSL=true. For example, PCSL_OUTPUT_DIR=%BUILD_OUTPUT_DIR%/pcsl.

ENABLE_ISOLATES

Required for building a CLDC implementation with multitasking capability. Must be set to true. If not explicitly set to true, the build defaults to false and CLDC is built without multitasking capability.

JAVACALL_OUTPUT_DIR

The location of JavaCall porting layer output. For example, JAVACALL_OUTPUT_DIR=%BUILD_OUTPUT_DIR%/javacall.

Building CLDC for a JavaCall porting layer on i386 Target Platform

  1. Set the JVMWorkSpace variable, as shown here.

    $ set JVMWorkSpace=%MEHOME%/cldc

  2. Set the JVMBuildSpace variable, as shown here.

    $ set JVMBuildSpace=%BUILD_OUTPUT_DIR%/cldc

  3. Change directory to %JVMWorkSpace%/build/javacall_i386_vc.

    $ cd %JVMWorkSpace%/build/javacall_i386_vc

  4. Run the make command as a single command-line string, as shown here.

    $ make ENABLE_PCSL=true PCSL_OUTPUT_DIR=%BUILD_OUTPUT_DIR%/pcsl ENABLE_ISOLATES=true JAVACALL_OUTPUT_DIR=%BUILD_OUTPUT_DIR%/javacall

The generated CLDC output is found under %JVMBuildSpace%/javacall_i386_vc/dist.


Running CLDC Software

Once you build the CLDC software, 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.

Running CLDC on a Linux on i386 or Linux on ARM Target Platform

  1. Change to the CLDC build space for your target platform:

    On a Linux on i386 target platform, use:

    $ cd $JVMBuildSpace/linux_i386/dist

    On a Linux on ARM target platform, use:

    $ cd $JVMBuildSpace/linux_arm/dist

  2. Enter the following command:

    $ bin/cldc_vm -classpath location-of-compiled-applications/classes classname

    For example, to run the HelloWorld application:

    $ bin/cldc_vm -classpath /src/classes HelloWorld

Running CLDC on a JavaCall porting layer on i386 Target Platform

  1. Change to the CLDC build space for the JavaCall porting layer on i386 platform:

    $ cd %JVMBuildSpace%/javacall_i386/dist

  2. Enter the following command:

    $ bin/cldc_vm.exe -classpath location-of-compiled-applications/classes classname

    For example, to run the HelloWorld application:

    $ bin/cldc_vm -classpath C:/src/classes HelloWorld


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 all build platforms.

  1. Change to the default build directory for your build platform.

    For example, this could be a Linux on i386 platform, as shown here.

    $ cd $JVMWorkSpace/build/linux_i386

  2. Build Javadoc tool HTML documentation.

    $ make docs_html

Viewing phoneME Feature Documents

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



first | prev | next-last