A Java ME Embedded Emulator Command-Line Reference

The Java ME Embedded Emulator can be started from the Windows or Linux command line.

Starting the Java ME Emulator from the Command Line

The Java ME Emulator can be started from the Windows or Linux command line.

To start the Java ME Emulator, run the following command:

emulator.exe command [option ...]

When you start the emulator, you can pass a command to it that defines what it should do, and options that adjust the behavior.

List of Commands to Pass to the Java ME Emulator

The following commands can be used to define what the emulator should do:

-help

Prints the usage information.

-version

Prints the version information.

-Xautotest:<jad_file>

Runs the specified JAD file on the emulator in autotest mode. The following options cannot be used with this command:

  • -Xdebug
  • -Xrunjdwp
  • -Xprofile
  • -Xnetmon
-Xdescriptor:<jad_file>

Installs and runs the specified JAD file on the emulator in normal mode, then removes it when you close the emulator.

-Xi3test[:<option>[=<value>],...[,<testclass>]]

Runs tests on the emulator. You can specify the testclass argument to run just that one test. Otherwise, it runs all known tests.

The following options are available:

  • -filter=<pattern>: Runs tests which names contain the specified pattern.
  • -timeout=<min>: Sets the maximum execution time in minutes.
  • -keyword=<key>: Runs tests which keywords contain the specified key.
  • -list: Lists all known tests.
  • -selftest: Runs the framework's self test.
  • -verbose: Enables verbose output.
-Xjam[:option]

Runs the interactive Java application manager. You can pass several -Xjam commands with different options. The following options are available:

  • force: Can be used in conjunction with install to force the removal of an IMlet that is already present in a storage name.
  • install=<jad_url>: Installs the IMlet from the specified URL.
  • list: Lists all installed IMlets and exits.
  • remove={<name>|<number>}: Removes the IMlet in the specified storage name or number. The system-defined application all can be used to remove all IMlets.
  • run={<name>|<number>}: Runs the IMlet in the specified storage name or number.
  • storagreNames: Lists all storage names in the order of assigned storage numbers and exits.
  • transient=<jad_url>: Installs, runs, and removes the IMlet from the specified URL.
-Xquery

Prints information about available devices and exits. If used with the -Xdevice option, prints information only about the specified device.

-XshutdownAll

Closes the emulator frame and shuts down the device manager.

Options to Adjust the Behavior of the Emulator

The following options can be used to adjust the behavior of the emulator:

-D<property>=<value>

Sets the system property to a value. This option can be used during development to pass parameters to an application without rebuilding and repackaging it.

-Xdebug

Enables runtime debugging. This option should be used with the -Xrunjdwp option that runs and controls a Java Debug Wire Protocol (JDWP) session.

-Xdevice

Runs the specified device in the emulator. If this option is not specified, the default device is used, except for the -Xquery command that prints information about all available devices if -Xdevice is not present.

-Xmemmon

Enables the Memory Monitor.

-Xnetmon[:suspend=y|n]

Enables the Network Monitor. The suspend option means whether to suspend the application run until the network monitor connects.

-Xprofile[:file=<file>]

Enables the CPU Profiler. You can use the file argument to specify the file to which the snapshot should be stored. If you do not specify the file argument, profiler data will be passed on to a connected profiler and not stored as a snapshot.

-Xrunjdwp:<name>=<value>,...

Runs and controls a Java Debug Wire Protocol (JDWP) session when the -Xdebug option is enabled. You should specify at least one name and value pair. Multiple pairs are separated by commas. The following names are available:

  • address: Specifies the address for the debugger connection. The value is specified as a host name and port number separated by a colon. If you specify only the port number, than localhost is assumed as the host name.
  • server: Specifies whether to start the debug agent as a server. The value is specified as y or n. By default, it is set to n.
  • suspend: Specifies whether to suspend the JVM immediately after establishing a connection with the debugger. The value is specified as y or n. By default, it is set to n.
  • transport: Specifies the transport mechanism used to communicate with the debugger. The default value is dt_socket.

Examples

The following example relates the Windows platform only. It shows how to run the sample_imlet.jad file on EmbeddedDevice1, assuming Oracle Java ME SDK 8.3 was installed to the default location:

C:\Program Files\Java_ME_platform_SDK_8.3\bin> emulator.exe -Xdevice:EmbeddedDevice1 -Xdescriptor:C:\Program Files\Java_ME_platform_SDK_8.3\apps\sample\sample_imlet.jad