Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 31
Registered: ‎12-02-2008
My Device: Not Specified
Accepted Solution

First Time JDE Use

Please pardon the "noob" nature of this question!  I'm trying to get a "hello world" app to work for the first time.  One of my Java files in the project has the line:

 

import java.util.Calendar;

 

This is really simple stuff.  For example - when compiling this using javac from DOS - it works great.  But when using the BlackBerry IDE I get the following compilation errors:

 

D:\Java\BlackBerry\Algorithms.java:84: cannot find symbol
symbol  : variable DAY_OF_YEAR
location: class java.util.Calendar
          sysdate.add(Calendar.DAY_OF_YEAR, delta);
                              ^
D:\Java\BlackBerry\Algorithms.java:210: cannot find symbol
symbol  : method contains(java.lang.String)
location: class java.lang.String
        if (lp_cipher_input.contains(kHeaderStr) && lp_cipher_input.contains(kFooterStr)){
                           ^
D:\Java\BlackBerry\Algorithms.java:210: cannot find symbol
symbol  : method contains(java.lang.String)
location: class java.lang.String
        if (lp_cipher_input.contains(kHeaderStr) && lp_cipher_input.contains(kFooterStr)){
                                                                   ^
3 errors

 

I tried right-clicking on the project, selecting "Properties..." and adding entries under the "Imported JAR Files" area.  Even though I "pointed it" to JAR files under my JDK directory, it still wouldn't work.

 

Any help you could give me would be greatly appreciated!  Thank you!

Joe

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: First Time JDE Use

Look like you are trying to compile "desktop" J2SE code with the J2ME compiler and libraries.

 

Open up the javadocs for java.util.calendar and you will see that DAY_OF_YEAR is not implemented.

 

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: First Time JDE Use

[ Edited ]

Just installed OS on my new computer and there is no JDE installed, so I cannot check. But I think there is no such constant declared in java.util.Calendar class that included into RIM API.

 

java.util.Calendar from Java SE and java.util.Calendar from RIM API -- are a bit different.

 

Check this link: http://www.blackberry.com/developers/docs/4.0.2api/java/util/Calendar.html

 

Message Edited by tbilisoft on 18-12-2008 05:07 PM
New Developer
Posts: 31
Registered: ‎12-02-2008
My Device: Not Specified

Re: First Time JDE Use

Wow!  Thank you for such a prompt response.

 

Joe

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: First Time JDE Use

For a novice Blackberry developer the following links will be useful:

 

  • Developers Knowledge Base
  • Blackberry Development Documentation
  •  

    and welcome to the club Smiley Happy

    New Developer
    Posts: 31
    Registered: ‎12-02-2008
    My Device: Not Specified

    Re: First Time JDE Use

    Thank you, sir!
    New Developer
    Posts: 4
    Registered: ‎12-18-2008
    My Device: Not Specified

    Re: First Time JDE Use

    Thank you for this as well.  I was looking for some kind of FAQ, this is perfect!
    Highlighted
    Developer
    Posts: 5,339
    Registered: ‎09-20-2008
    My Device: ***
    My Carrier: ***

    Re: First Time JDE Use

    You're welcome Smiley Happy

     

    Also check the following links:

     

    Developers @ Blackberry site

     

    Developer Video Library