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 file in Eclispe, whether it has the correct MIDlet name, class position and icon, like this:


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



I have a question. After changing J2ME Polish's code, for example I change StringItem in UI subdirectory, then replace 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:

--com.yourcode.code(your own src structure)

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