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: 1
Registered: ‎05-23-2009
My Device: Not Specified

CLDC Application Entry Point Not Called

I am developing my first application for my storm using the JDE. My application is of type CLDC and my public static void main(String[] args) {} method is never being called. However the compiler does not issue a "no entry point found" error message. When I run my app in a simulator or on the device itself it appears to simply exist immediately. Here is gutted version of my code (without extraneous member definitions and such, for clarity):

 

 class CarpeContactsClient extends UiApplication implements IProcessSubject {

        public static void main(String[] args) {

        if (args.length > 0) {

            for (int i = 0; i < args.length; ++i) {

                System.out.println(args[i]);

            }

        }

        CarpeContactsClient client = new CarpeContactsClient();

        client.enterEventDispatcher();

     } 

} 

I have tried setting a breakpoint at the top of main() but execution never seems to arrive there. Could someone please have mercy on my ignorance, and clue me into what I am missing?

 

Thanks,

 

-Aaron 

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

Re: CLDC Application Entry Point Not Called

Hello, Aaron.

 

Check this link:

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&thread.id=17514

 

there is a project attached with simple and well-commented HelloWorld application I've created some time ago.

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

Re: CLDC Application Entry Point Not Called

Regarding your code, there is a simple rule.

 

Always declare the main class as public.

 

Like that:

 

public class CarpeContactsClient extends UiApplication implements IProcessSubject {

 

Otherwise operating system is unable to start the application properly.

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

Re: CLDC Application Entry Point Not Called

Also as you're a newbie check this link:

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&thread.id=13264&jump=true

 

there is helpful information for you.