• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

J2ME Polish - Problems with CLDC 1.1 Libraries

 
Elías Turbay
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, sorry for my poor English...

I have namy problems integrating J2ME Polish with an existing Project... It looks like I can't use the CLDC 1.1 libraries. What I need to do to resolve that problem ??? Thanks a lot.
I'm using NetBeans 4.1, and I try to import the file "midp2-cldc11.jar" to the "Libraries and Resources", but nothing happens. Should I modify the build.xlm? I'cant find which parameter can be added to resolve this problem.

I get the following errors:

float f = 15;
System.out.println(f);

...MenuMidlet.java:91: cannot resolve symbol
symbol : method println (float)
location: class java.io.PrintStream
System.out.println(f);


The same happens with:

symbol : variable Double
location: class examples.PreVenta
prod.precioUnitProducto = Double.parseDouble(Fields[2]);


and with:

symbol : method valueOf (double)
location: class java.lang.String
System.out.println("SubTotal: " + String.valueOf(subT));


and with:

symbol : method equalsIgnoreCase (java.lang.String)
location: class java.lang.String
if (cad.equalsIgnoreCase(subs)) {


and with:

symbol : method writeDouble (double)
location: class java.io.DataOutputStream
dbos.writeDouble(precioUnitProducto);
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well it is definitely a classpath issue. Maybe the CLDC 1.0 version is also in the classpath and appears first in the list, so that one is used instead of your CLDC 1.1 jar file.

This isn't an issue about J2ME Polish, because it does work with CLDC 1.1

Mark
 
Elías Turbay
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark !

What I do not understant is why the Project works fine when I don't use J2ME Polish.... �?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the classpath set in their build.xml. Maybe you just have to set that up to point to CLDC 1.1.

Mark
 
Elías Turbay
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark

I have the following in the build.xml file:

<!-- Definition of the J2ME Polish task: -->
<taskdef name="j2mepolish"
classname="de.enough.polish.ant.PolishTask"
classpath="${polish.home}/import/enough-j2mepolish-build.jar:${polish.home}/import/midp2-cldc11.jar:${polish.home}/import/jdom.jar:${polish.home}/import/proguard.jar:${polish.home}/yguard-lib.jar:${wtk.home}/wtklib/kenv.zip"/>

I also try to put the second line,

<deviceRequirements if="test">
<requirement name="Identifier" value="Generic/midp2" />
<requirement name="JavaConfiguration" value="CLDC/1.1+" />

but I get the error:
"build.xml:85: Your device-requirements are too strict - no device fulfills them."

Also, when I get the "cannot resolve symbol" error, the following message is shown...
"Alternatively you might need to define where to find the device-APIs. Following classpath has been used: []."
=S
Why I get this message? If I have define the classpath in the "taskdef" section...

Trying to resolve this I put the line:
apiDir="${polish.home}/import"
in the "build" section .... but nothing happens

Please HELP !!!
 
Ashish Parekh
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi.. just set ur build.xml values according to ur project...

u have to make 2 changes..
1) Midlet name and it's class path in build.xml
2) deviceproperties as per ur device requirement.

Nothing else...

As per ur problem it's related to class which ur IDE not able to fine out...
so just config. it's resources as well as lib path.
 
Elías Turbay
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to know If the classpath should be defined as follows:

<taskdef name="j2mepolish"
classname="de.enough.polish.ant.PolishTask"
classpath="${wtk.home}/lib/clcdapi11.jar ... "/>

Because I try a lot of changes but nothing happens .... What I'm doing wrong ???

HEEEEEELLLLLPPPPPPPPP !!!
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so In Pro J2MEPolish book, it does not need to have the CLDC 1.1 jar in the classpath part of the taskdef tag.

Second the deviceRequirements that you have is what it would need to be. The thing that it is reporting I think is that when it looks in the device xml file it doesn't find any devices that match that criteria. Maybe see if you can get an updated version of that from the J2ME Polish website.

Mark
 
Elías Turbay
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark,

Thanks for help me every time

I'll try to do what you tell me ... But I have the version 1.2.4

In the example that comes with J2ME Polish, I only add the lines:
float f = 10;
System.out.println(f);
And I get the "cannot resolve symbol" error ...
If I don't use any of the CLDC 1.1 classes everything works fine...
That is what I don't understand...
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting.

Unfortunately, that goes beyond my knowledge.

Mark
 
Elías Turbay
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark

I can't be fooler ...

When you told me about the "devices.xml" file I take a look at this and I discovered the problem ...

The Identifier "Generic/midp2" do not use CLDC1.1, that's the problem.
I should use the identifier "Generic/midp2cldc11" or any other that use the CLDC1.1 Libraries.

I sinned of lack of curiosity, but it served me to learn a lot of things

Bye bye and thanks a lot
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool, I am glad you found it. If I was able to use J2ME Polish in my free time, I might have known that, but I have just an overall view that I received from the J2ME Polish Pro book.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic