2

I'm using LWUIT as my j2me project's GUI library. I've generated a netbeans project using LWUIT Resource editor. And I have a separate project, in which I write additional components for my j2me program.

In that separate project, I have a class TextForm extends Form, where Form is a standard LWUIT's form. When I try to do:

TextForm a = new TextForm();
a.show();

everything's works fine. But when I do:

Form a = new TextForm();
a.show();

I have a compile-time error:

Error preverifying class userclasses.StateMachine
    VERIFIER ERROR userclasses/StateMachine.onConnect()V:
Cannot find class client/lwuit/components/TextForm

(the TextForm class contains in the client.lwuit.components package of my separate project with components). So, is there any solution for this problem?

UPD:
a.show() method is a standard Form method. It is responsible for displaying forms. It's not so important here.

gnat
  • 6,213
  • 108
  • 53
  • 73
Angstrem
  • 346
  • 1
  • 4
  • 14

1 Answers1

1

For anyone, who cares: the error was in the project's build-impl.xml file (it's location is /nbproject/build-impl.xml). It's generated incorrectly. The error is in the line

<nb-preverify srcdir="${preverify.sources.dir}" destdir="${preverify.classes.dir}" classpath="${platform.bootclasspath}:${extra.classpath}" configuration="${platform.configuration}" platformhome="${platform.home}" platformtype="${platform.type}" commandline="${platform.preverifycommandline}"/>

Look at this tag's attribute named classpath:

classpath="${platform.bootclasspath}:${extra.classpath}" 

In order to tell the preverifyer where your included libraries are, change this attribute to the following form:

classpath="${platform.bootclasspath}:${extra.classpath}:${libs.classpath}"

If you look into the project.properties file (it is in the same directory as the build-impl.xml), you can see, that libs.classpath variable provides a path to all your project's libs, that you include.

P.S.: yes, it seems pretty weird, that this affects polymorphism in such way, but it solved the problem...

Angstrem
  • 346
  • 1
  • 4
  • 14
  • If you solved your own problem then you should mark this as the answer! Or just delete the question altogether if you think it is unlikely to help anyone else. – Nate W. Dec 13 '12 at 23:12
  • The system says, that I'll be able to mark this as the answer only in 14 hours. – Angstrem Dec 14 '12 at 21:49