Pstros - the j2me execution environment for j2se

[ download page ] [ configuration info ] [ Eclipse integration ] [ Web integration ] [ misc. info ]

Pstros primary objective is to run your code written for j2me midp api on the pc utilizing the j2se environment.

Someone might call such application an "emulator" but in this case all the code is run on a common java virtual machine and there is no real emulation involved, however the results are similar.

Why I made the pstros when there are many emulators developed by the device vendors? The short answer is that many of them are slow, some of them don't work at all on my computer and even the "good" ones don't produce correct visual output. Pstros tries to be as fast as possible, draws accuratelly and supports various apis.

Pstros is intended mainly for developers to help them create midp applications, but is simple enough to serve as the basic midlet viewer on computer platforms which lack support of the device vendors.

* Pstros is provided for free. Please see the terms at the bottom of the page.

* There is a similar project targeted to Doja 1.5 api called Jade.

* Pstros core methods were recently ported to Nintendo DS. Info about this project is here.

* MIDP code along with Pstros can be compiled into the native executable code so it can run without a java machine installed on the computer. Technology demo application is here.

Key features of the pstros:

- runs your j2me midp application: displays it on the separate window, accepts the keypress, draws the screen and plays the sound.
- multiplatform: is written purely in java (and AWT) and should work on many platforms
- easy debug: debug non-obfuscated j2me code in your favourite IDE that supports java debugging.
- configurable screen size and device key codes
- java interface that allows you to embed the pstros in other Java application
- integrated image viewer: helps the programmer to inspect images currently loaded in the device memory
- integrated class monitor: allows to watch class member variables in separate window
- supports the sixlegs image library for image loading
- save screenshots and videos of your j2me application
- rescale the output screen on keypress (saves your eyes during developement, larger output for the application "live" presentations)

Things pstros cannot do:

- no support for 3D api.
- no "real device speed" emulation
- non complete support for some midp UI classes wich are not game or canvas drawing related (like items, lists etc.)

How to run and test the pstros:

At first you have to have some j2me classes or j2me application which you want to run. Without them the pstros can not operate (if you don't have any, you can test it for instance with the JBenchmark 1.0 or 2.0 applications)

Download the pstros package from here and store it in the accessible directory. Pstros can run your j2me application either in unpacked form (classes and resources stored in the local directory) or in the packaged form (jar and jad files).

1) packaged application can be run from command line this way:
java -jar pstros.jar MyGame.jad -w128 -w160
The first pstros parameter is the name of the jad file (the application descriptor), following parameters are the width and height of the device screen. note: custom classloader is employed to load classes and resourcess from the package.

2) unpacked application can be run from command line this way:
java -jar pstros.jar -CMyMIDlet -AMyGame -w176 -h220 -s2
Parameter -C specifies starting class of your application (must extend the MIDlet class), parameter -A specifies the application name (for the rms distinction), parameter -w and -h specifies width and height of the virtual device screen, parameter -s specifies initial screen scale factor.

3) "developer" invocation method suitable for IDE (like Eclipse) which allows you to specify external main function that starts your application. Use ole.pstros.MainApp as your start class and specify the additional parameters mentioned in the second example. This invocation method can be also used from command line this way:
java -Xbootclasspath/a:pstros.jar;sixlegs.jar;MyGame.jar ole.pstros.MainApp -CMyMIDlet -AMyGame -w176 -h220
note: here you can see how sixlegs library can be employed by specifying it on the bootclasspath.

Input and keys:

Pstros has no visual representation of the device other than the current device screen. So you can control the apllication via keypresses only. While some people might consider it "user-unfriendly" I found it quite handy in my daily developer work (and if you really need to have some clickable skin of the device you may create your own).

Here is the default key mapping:

Enter - fire
Esc - exit the application and close the pstros
F1 - left soft key
F2 - right soft key
Arrows - directional arrows
numeric keyboard - number keys, key placement match the device keys (for example number 9 on the pc numeric keyborad match the number 3 on the phone keyboard)
F9 - hide/show notify test
F11 - save screenshot
F12 - starts/stops video capture
Alt+v - turn on/off the verbose mode
Alt+i - open image viewer window
Alt+m - open class monitor window
Alt+d - open distance, zoom, color window
Alt+g - directly invoke garbage collector
Alt+1 - set screen scale 1
Alt+2 - set screen scale 2
Alt+3 - set screen scale 3

Host platforms:

Pstros was successfully tested on Windows and Linux platforms, also I have some positive reports that it runs on Mac too. It was succesfully tested on the jamvm virtual machine using gnuclasspath on Linux. Pstros core methods were also ported to Nintendo DS, info about this project is here.

Terms of use:

This version of Pstros software is freeware. You may use it, but you must not sell it and you must not distribute it either standalone or as a part of your product. Also by using the Pstros software you acknowledge and agree with the fact that Pstros software may not produce exact and/or correct results.


You can reach the Pstros author here: ole00 at post dot cz. If you find Pstros useful, please send a donation to his PayPal account (use the same e-mail address as a recipient address). Any small amount is wellcome. Thank you :-)