Skip Headers
Oracle® Java Micro Edition Software Development Kit Developer's Guide
Release 8 for Windows
E50624-01
  Go To Table Of Contents
Contents

Previous
Previous
 
Next
Next
 

A Using the Command-Line Emulator

The Oracle Java ME SDK 8 Embedded Emulator can be started from the Windows command line. After the emulator starts, it runs and behaves the same as it does when started from NetBeans IDE 8.0.

Starting the emulator from the Windows command line enables you to use a number of emulator options. For more information, see Useful Emulator Command Options.

You can find the Oracle Java ME SDK 8 command-line emulator under bin in the Oracle Java ME SDK 8 installation directory.

Using the Oracle Java ME SDK 8 Emulator

To start the emulator from the Windows command line:

  1. Open the Windows command prompt. There are several ways to do this:

    • Press Win+R on the keyboard, or open the Start menu and select Run to open the Run window. Now, type cmd and click OK.

    • Open the Start menu, search for cmd.exe and run it.

    • Double-click C:\Windows\System32\cmd.exe.

  2. Change to the bin directory in the Oracle Java ME SDK 8 installation directory. For the default location, use the following command:

    > cd C:\Java_ME_platform_SDK_8.0\bin
    
  3. Run the emulator.exe command. Use the -Xdevice option to specify the device you would like to run, and the -Xdescriptor option to specify the JAD file you would like to run on the device. For example, to run the sample_imlet.jad file on EmbeddedDevice1, use the following command:

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

    Note:

    You can run the emulator command without the .exe extension.


Useful Emulator Command Options

The emulator command can be used with the following command-line options:

-help

Displays usage information with a complete list of command-line options.

-Xjam:list

Displays a list of installed IMlets.

-Xquery

Displays a list of supported devices.

-Xjam:install=URL

Installs a JAD file over the air and executes the IMlet. You must specify a URL of the JAD file, for example:

> emulator -Xjam:install=http://www.example.com/TestJAD.jad
-Xjam:run={storage_name|storage_number}

Runs an IMlet. You must specify either the storage name or storage number, which can be displayed using the -Xjam:list command.

-Xjam:remove={storage_name|storage_number|all}

Removes an IMlet. To remove a specific IMlet, you must specify either the storage name or storage number, which can be displayed using the -Xjam:list command. To remove all IMlets, specify all as the parameter.

-Xdescriptor:path

Installs a JAD file, executes the IMlet locally, and removes it after completion. You must specify the path and name of the JAD file, for example:

> emulator -Xdescriptor:C:\imlets\sample.jad
-Xautotest:URL

Runs an IMlet in autotest mode. You must specify the URL of the JAD file, for example:

> emulator -Xautotest:http://127.0.0.1:8080/getNextApp.jad