Forum Stats

  • 3,872,715 Users
  • 2,266,464 Discussions


How can I run multiple midlets in parallel via the raspberry pi cmd line interface?

2715241 Member Posts: 4
edited Aug 6, 2014 9:57AM in Java ME Embedded

I am trying to run multiple midlets at the same time on my raspberry pi.

From netbeans point of view I am able to deploy and run them. But for my applications I want to auto start multiple midlets on the raspberry pi.

On the cmd line interface of java me 8 I have commands to install a midlet and run a midlet.

But i am not able to start multiple midlets.

Can someone explain to me how I can do this?


  • Hi!

    Could you please clarify a bit: do you want auto-start behavior of your applications or be able to start them manually via CLI?

    Because "auto start" means that applications are started by Java once you start Java itself and in order to make it happen you shall mark your applications appropriately (check MEEP spec for "MIDlet-<n>-Type" application attribute value "autostart"). If this is the case, have you added this attribute?

    If you want to run them manually you should be ale to do so via CLI just the same way as you start one application (via "ams-run" command).

    Either way, could you also please clarify what are the symptoms of the problem? E.g. on CLI what are the messages you receive back (if start is unsuccessful what is the error message etc).

    In addition please mind that there is limit on number of simultaneous VM tasks. If I'm not mistaken by default it is 6: 2 of them are used by system code and each running MIDlet consumes 1 VM task. If you want to increase it please change the value of "MAX_ISOLATES" property in jwc_properties.ini file. The maximum supported value is 16



  • 2715241
    2715241 Member Posts: 4

    manually via command line interface of the RPI.

    Within java me 8 on the RPI I have the following commands:

    when I install 2 midlets, I see with listMidlets 2 suites installed which I can start with runSuite <suiteId>

    So I can start only one.

    When I install a suite with multiple midlets in it I see with listMidlets 1 Suite with multiple midlets in it.

    When I start a suite with multiple midlets I also see output of only 1 of the midlets.

    What is the ams-run command ?

  • Ah! I see now. Actually there is own command line interface of Java itself. In order to use it you have to start the proxy.jar file provided along with Java ME binary. However there is more easy way - you can use Java ME SDK for this purpose. (You shall already have it installed and configured, because otherwise you would not have Netbeans connected to Java). Just start ME SDK in application management mode, by running "emulator.exe -Xjam" command. There you can also install and remove MIDlets but as well start/stop them and observe their respective logs



  • 2715241
    2715241 Member Posts: 4

    Hi Andrey,

    Okay, I am aware of the Xjam commands but that is still via a connection to the raspberry pi.

    I know I can start multiple midlets via netbeans and xjam interface.

    But i am looking for a way to start them on the RPI, so I can later on add a script to do the work for me.



  • Hi Mark,

    Ah, I did not get that you want to initiate it locally on RPi, without external connection. Unfortunately there is no standard out of the box way to do this from the script. However, there are lot of work-arounds:

    - mark your MIDlets as auto-started (MIDlet-<n>-Type: autostart). In this case the MIDlet will be started automatically once you start Java ME (e.g. via

    - write a MIDlet which would start other MIDlets via SWM API (part of MEEP JSR 261)

    - use CLI of the proxy.jar. you can start it with Java SE on the RPi and then pass it a set of ams-run commands (e.g. "java -jar proxy.jar -socket -i < cmd.txt", where cmd.txt contains set of lines "ams-run <N>")


This discussion has been closed.