I compile a J2ME Polish program using Ant. Everything works very well so i believe my build file is pretty good. However, when i try to use the class called FakeContainerCustomItem (which belongs to the Polish classes) i have the "class not found" message. The class is in one of the Jar files in my import directory.
How can i force Ant to consider the jar file? Should i add an entry in my build file?
I assume that by "when i try to use the class" you mean you are getting the "class not found" exception when you are running your application. How are you running the application? From the command line (or from a script or batch file)? Or from Ant? What is the classpath you are using, and does that classpath conmtain the JAR file that contains the FakeContainerCustomItem class?
What you posted is an entry that defines an new ant task. This entry is not used to compile your code. Do you have a "javac" task somewhere?
Please post the full console output for when you run Ant (including the command line you entered). If the build.xml is not too long, post it also. Don't forget to use 'code' UBBCode tags (you can select the text and click the "Code" button below the editor window.)
what J2MEPolish do is one of the most strange concepts in IT industry.
let me explain
J2MEPolish lets you write normal midp code and convert it to rich UI. how this is done?
j2mepolish has implementation for all midp ui classes but they reside in package de.enough.polish.ui not javax.microedition.lcdui and to accomplish its strange task, the ant task you mentioned pre-processes your code and change imports at beginning of file. so you end up with your code importing j2mepolish ui classes not j2me midp classes.
you write and then use it like this j2mepolish and task replaces with so, the actual class used at runtime is j2mepolish class.
j2mepolish defines new items and screens that are not in midp specifications and to make your ide happy with code you write, they give you the file "enough-j2mepolish-client.jar" to include which contains classes that seems to inherit midp classes but actually in runtime they are not. classes in this file aren't real classes that are used in runtime. they are just a hoax to make ide happy with code (actually this doesn't work and ide still become mad and complain half of your code). and this is clear from the class name as it starts with "fake".
so, don't depend on hierarchy of classes in this jar, and don't depend on javadoc of j2mepolish classes.
just use documented classes in j2mepolish visual guide as them or if you want to do some hacking, you have to consider these facts.
On top of spaghetti all covered in cheese, there was this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop