|
Eclipse project setup For running the j2me code from the Eclipse you have to have Eclipse installed and Pstros package stored somewhere in your filesystem. There is no need to install WTK or other eclipse plugins. You will do with the Eclipse and Pstros just fine. How to setup Eclipse project: - create new Java project - go to project properties (via context menu of the project) - setup the project directories (I recomend to store source files in directory "src", setup the default output folder in directory "bin" and store your resource files in directory "res" ) - switch to the "Libraries" tab - click the "Add External JARs..." button - find and select pstros.jar as the external jar file - apply your changes Now you should be able to use most of the J2ME classes in your project's java files. |
|
Running your J2ME code In order to run your midp code there should be a class that extends the javax.microedition.midlet.MIDlet class in your project. Create new "Run configuration" like this:
1) click on the "Java Application" item 2) click on the "New" button to create new configuration 3) type in the ole.pstros.MainApp 4) check-in the "Include external jars..." Switch to the Arguments tab:
5) type in the pstros parameters
-C the class name of your start class (in the example the AircraftDemo is the
class name) -A application name (if yor code uses rms) -w width of the device screen -h height of the device screen -s screen scale Specify here other pstros parameters you might need. Switch to the Classpath tab:
Now you have to add the directory where your resource files are stored. 6) un-check "Use default class path" 7) click on the "Advanced..." button and add your resource folder 8) the resource folder shoud be seen on the list 9) optionally click on the "Add external jar..." to add the Sixlegs libray That's it! Now apply your changes and press the "Run" button.
|