Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem compiling first midlet

 
megha ghanekar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,
I am trying to compile my first midlet using ktoolbar. In my code i am appending 2 strings. At this line it gives me an error to load StringBuilder class? Can anyone help me out?
Please tell me the settings required to compile my code. If there is any specific order of steps to be followed, please tell me?

Warm Regards,
Meghana.
 
Girish Nagaraj
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get Error loading class... messages when running the preverifier.

First, check that your Java sources and libraries can be used with CLDC and MIDP APIs.

Then, ensure that you installed the J2ME Wireless Toolkit in a directory whose path does not contain any spaces. For example, the toolkit will not work with the path C:\Program Files\WTK22.

If you installed the toolkit in a directory whose path contains spaces, you must uninstall the toolkit and reinstall it in a directory whose pathname does not contain any spaces.

---------------------***---------------------

1) Install jdk version 1.4 or higher
2) Set classpath properly
3) Try simple java program (use notepad for editing source code) to ensure that you have correctly set classpath
4) Then try compiling your program on Wireless toolkit

I suggest you go through faqs once in directory where you have installed Wireless tool kit.

Try Demo programs & see what happens.

By the way are you appending String?or StringItem?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for my memory, but I don't think there is a StringBuilder class in J2ME.

Mark
 
Faraz Masood
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i agree with mark , everything that is in j2se is not *necessarily* a part of j2me due to the limitation of resources on mobile devices

make sure to consult the trimmed down version of APIs when you are writing the code for mobile devices
 
Faraz Masood
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you like eclipse , it is highly likely that you gonna like the EclipseMe plugin to develop j2me apps

its very coool , so give it a try whenever you feel like doing so
 
Ian Strain
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post your code and I'll see if I can spot anything wrong with it
 
Rashid Mayes
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use StringBuffer instead of StringBuilder. J2ME is not the same as J2SE. Use the Javadoc included with the WTK as a reference. Be mindful of the platform,For example, doubles are not available in cldc 1.0.

If you are using an IDE, make sure that you have the MIDP/CLDC libs of your target platform in the classpath and not the J2SE libs. For example, if your target platform is cldc 1.0, you should not include the cldc 1.1 lib is your classpath. There are J2ME friendly IDEs and plugins that will make coding a bit easier.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic