You are here

Touch J2ME Polish--3. Debug and Build with Ant

At first you should pay attenion to the source folder, if you have converted one existing project to Polish project. Polish's default source directoty is source/src, and default resource directory is resources. Please go to the project's properties and change the Java Build Path setting like this. Otherwise you can not build it successfully.

Now you can debug or build the project with Ant.

Maybe you are not familar with Ant Builing like me. Open and check midlet.properties file in Eclispe, whether it has the correct MIDlet name, class position and icon, like this:

MIDlet-1=MIDletName,iconname.png,yoursourcepath.midlet.MIDletName

Run build.xml, if successful,  the outputted jar and jad files are in dist folder in your project root.

And last, for avoiding some strange problems, please make sure you have delete the 2 folders real and test in build folder, before you debug or build the project everytimes!  Or if you are running Ant, run the code :  ant clean

Refer:
http://www.j2mepolish.org/docs/mepose-running.html
http://www.j2meforum.com/viewtopic.php?t=1431

Comments

I have a question. After changing J2ME Polish's code, for example I change StringItem in UI subdirectory, then replace StringItem.java in \J2ME-Polish\lib\enough-j2mepolish-build.jar, I can build it by running Ant, run the code : ant, but can not debug or run in Eclipse. I think it's problem of Mepose, but I should how to change Mepose to resove this problem?

This is not a smart way to "modify" Polish code. If you want to use your own polish code, just create folders in sequence(src/de/enough/polish/ui) in your source folder, like this structure, and put your StringItem inside:

-res
-src
--com.yourcode.code(your own src structure)
--de.enough.polish.ui
--de.enough.polish.ui.StringItem
--de.enough.polish.ui.others_with_same_name_in_polish

And polish will use this StringItem replacing its native StringItem when pre-compling your code.And you can also use Mepose to debug it.