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: ‎11-17-2008
My Device: Not Specified

cannot inherit from final net.rim.device.api.ui.Ui

Hi,

 

I am new to BlackBerry dev and i was attempting to run the sample hello world app and i am receiving the following:

 

Building TestProject
C:\Program Files\Research In Motion\BlackBerry JDE 4.3.0\bin\rapc.exe  -quiet import=com\rim\samples\device\blackberry\browser\com_rim_bb_commonLib.jar;..\lib\net_rim_api.jar codename=..\bin\TestProject ..\bin\TestProject.rapc warnkey=0x52424200;0x52525400;0x52435200 "C:\Program Files\Research In Motion\BlackBerry JDE 4.3.0\bin\HelloWorld.java"
C:\Program Files\Research In Motion\BlackBerry JDE 4.3.0\bin\HelloWorld.java:17: cannot inherit from final net.rim.device.api.ui.Ui
public class HelloWorld extends Ui
                                ^
C:\Program Files\Research In Motion\BlackBerry JDE 4.3.0\bin\HelloWorld.java:17: Ui() has private access in net.rim.device.api.ui.Ui
public class HelloWorld extends Ui
       ^
2 errors
Error!: Error: java compiler failed: javac -source 1.3 -target 1.1 -g -O -d C:\DOCUME~1\andrewz\LOCALS~1\Temp\rapc_50116a3e.dir -bootcla ...
Error while building project

 

 

Here is my code:

 

package com.rim.samples.device.helloworld;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.system.*;
/*
* BlackBerry Java Applications that provide a UI
* must extend the Ui class.
*/
public class HelloWorld extends Ui
{
   
}

 

What can be wrong???

 

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

Re: cannot inherit from final net.rim.device.api.ui.Ui

You cannot extend Ui - this is a static singleton.

 

Extend UiApplication instead.

 

Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: cannot inherit from final net.rim.device.api.ui.Ui

lookup final in a random java book or online source.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter