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

Web and WebWorks Development

Reply
New Contributor
damien-jkr
Posts: 7
Registered: ‎02-19-2010
My Carrier: Studiant

BlackBerry Widget compilation error ?! WTF !

[ Edited ]

Hi,

 

I've got a problem with the final step of my application test, the execution, run as blackberry widget of my project and that is the code of my index.html :

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" id=”viewport” content="initial-scale=1.0,user-scalable=no">
<title>Insert title here</title>

</head>
<body>
<applet code="/applets/hello.class" width="500" height="200">
Applet Java ...
</applet>
<p></p>
</body>
</html>

 

 

certainly i've another code of the file hello.class and it's correct, I supposed :

 

 

import java.applet.*;
import java.awt.*;

public class hello extends Applet
{
    
    public void paint(Graphics g)
    {
        g.drawString("Salut tout le monde †");
    }
    
}

 

 

but i can't execute this widget and in the console i can see this error :

 

 

[RAPC] C:\Users\safeR\AppData\Local\Temp\widgetGen.19120275591267001930126.tmp\applets\hello.class: Error!: Invalid class file: Not a classfile
[ERROR] Error happened when running rapc.exe!
BUILD EXITED WITH 1 ERROR

 

 

Who can help me please ? :smileyvery-happy:

 

(i'm french sorry for my bad english)

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,702
Registered: ‎10-16-2008
My Carrier: Rogers

Re: BlackBerry Widget compilation error ?! WTF !

Hi damien-jkr,

 

The reason you widget is not compiling is because you are including an applet.  The BlackBerry browser does not support applets and the Widget Packager is trying to compile the Java class you have included in your widget zip.

 

You are not able to use applets in your widget code or in a web page viewed by the BlackBerry Browser

 

 

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
New Contributor
damien-jkr
Posts: 7
Registered: ‎02-19-2010
My Carrier: Studiant

Re: BlackBerry Widget compilation error ?! WTF !

Thanks.

 

but when i have searched solutions to input java in my widget i found the applet solution, so what kind of solution i supposed to used in my widget ?

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,702
Registered: ‎10-16-2008
My Carrier: Rogers

Re: BlackBerry Widget compilation error ?! WTF !

To build a Widget Extension written in Java you can follow the lab material found here:

http://na.blackberry.com/eng/developers/devbetasoftware/Lab_Widget_Extension.zip

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.