This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes Polish and importing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Polish and importing" Watch "Polish and importing" New topic

Polish and importing

Phil Brumby

Joined: Jul 08, 2005
Posts: 17
Ok i shouldn't be making hard work of this but i am, if someone could help i'd be very grateful.

Developing in NetBeans 4.1 with Polish and am trying to include the wireless media package. So in my source i have:

import javax.wireless.messaging.*;

And in build.xml i have in the classpath:

<property name="polish.home" value="C:\Program Files\J2ME-Polish" />

<taskdef name="j2mepolish"

Yet when i run it in test mode or release mode (it's just the demo polish project) i get package not found:

F:\Source\NetBean Projs\NewPolish1\build\test\Generic\midp2\en_US\source\de\enough\polish\example\ package javax.wireless.messaging does not exist

import javax.wireless.messaging.*;

1 error

What simple step am i missing here?

Shawn Fitzgerald

Joined: May 07, 2004
Posts: 25
Well I don't know about NetBeans, but in the WTK you would need to select in the settings that the project was to include the WMA APIs.
Messaging is not part of the standard MIDP2.0 specification, but is part of the JTWI specification. So you might also want to make that a requirement of the project.

Also don't forget to add permissions for calls to the WMA services, such as SMS. That would be an issue at runtime and would not get in your way for the compiling of your project.

Hope that helps.

DFW J2ME Sig co-leader<br />Author: <a href="" target="_blank" rel="nofollow">SMS for MIP2.0</a>
Phil Brumby

Joined: Jul 08, 2005
Posts: 17
Thanks Shawn but all of that seems fine, within the project settings of NetBeans i have under Optional Packages Wireless Messaging API ticked and building project within NetBeans environment is fine, no error...

(i run a netbeans build to use debug, and polish to make use of it's UI stuff)

The problem comes with the ant run build.xml polish version, with it i'm assuming i have to include the wireless api in the classpath settings in the build.xml but it won't compile??

Anyone else shed some light?

Phil Brumby

Joined: Jul 08, 2005
Posts: 17
Ooooh right the device requirements in build.xml!

changed Generic/midp2 to Generic/jtwi, bingo

I have exeeeeercised the demons, thanks Shawn.

wood burning stoves
subject: Polish and importing
It's not a secret anymore!