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
Developer
Posts: 134
Registered: ‎05-19-2012
My Device: Torch 9800, PlayBook 64GB, Dev Alpha
My Carrier: VIVO Brazil
Accepted Solution

"illegal start of expression" Error While Trying to Compile a WebWorks Extension

Hello,

 

I'm trying to compile a simple Web Works Extension to show a Dialog.alert(), just a simple code to start with WebWorks Extensions. The problem is that when I try to compile all my code with javac I'm getting a lot "illegal start of expression" errors on places that doesn't have any errors. Here is the console log:

 

Nathan-Camposs-MacBook-Pro:webworks Nathan$ javac -source 1.3 -target 1.3 -deprecation -classpath /Developer/Applications/Eclipse/plugins/net.rim.ejde.componentpack6.0.0_6.0.0.43/components/lib/net_rim_api.jar -sourcepath /Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/*

/Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:15: illegal start of expression
    public static final String FIELD_ALERT = "alert";
    ^
/Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:15: illegal start of expression
    public static final String FIELD_ALERT = "alert";
           ^
/Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:15: ';' expected
    public static final String FIELD_ALERT = "alert";
                 ^
/Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:16: illegal start of expression
    private Alert _callAlert;
    ^
/Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:18: illegal start of expression
    public AlertScriptable() {
    ^
/Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:18: ';' expected
    public AlertScriptable() {
                            ^
/Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:22: illegal start of expression
    public Object getField(String name) throws Exception {
    ^
/Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:22: ';' expected
    public Object getField(String name) throws Exception {
                          ^
/Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:22: ';' expected
    public Object getField(String name) throws Exception {
                                      ^
/Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:22: not a statement
    public Object getField(String name) throws Exception {
                                               ^
/Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:22: ';' expected
    public Object getField(String name) throws Exception {
                                                        ^
11 errors

Any ideas?

 

Best Regards,

 Nathan Campos 

If I helped you please click the "Like" button to support my work.
My apps: CherryNotes - Bookmarked - Requests
Social Me: about.me - Twitter
Developer
Posts: 134
Registered: ‎05-19-2012
My Device: Torch 9800, PlayBook 64GB, Dev Alpha
My Carrier: VIVO Brazil

Re: "illegal start of expression" Error While Trying to Compile a WebWorks Extension

I've solved this. I was declaring that all inside a constructor.

Sorry.
If I helped you please click the "Like" button to support my work.
My apps: CherryNotes - Bookmarked - Requests
Social Me: about.me - Twitter