Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Ant error : Missing class in J2ME Polish

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,

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?

Regards
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
William Coburn
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

The error occurs when i build my source files. I put these lines into my build.xml :

The file enough-j2mepolish-build.jar contains the class FakeContainerCustomItem.

Maybe there is a better way to include other librairies in the classpath. Could you help me?
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.)
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
for example,
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
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic