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.
The following commands can be used to define what the emulator should do:
Prints the usage information.
Prints the version information.
Runs the specified JAD file on the emulator in autotest mode. The following options cannot be used with this command:
-Xdebug
-Xrunjdwp
-Xprofile
-Xnetmon
Installs and runs the specified JAD file on the emulator in normal mode, then removes it when you close the emulator.
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.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.Prints information about available devices and exits. If used with the -Xdevice
option, prints information only about the specified device.
Closes the emulator frame and shuts down the device manager.
The following options can be used to adjust the behavior of the emulator:
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.
Enables runtime debugging. This option should be used with the -Xrunjdwp
option that runs and controls a Java Debug Wire Protocol (JDWP) session.
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.
Enables the Memory Monitor.
Enables the Network Monitor. The suspend
option means whether to suspend the application run until the network monitor connects.
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.
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
.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