Hi I was hoping somebody could help me
I have installed the s60(nokia) java on my laptop and i am trying to get the helloworld program running. The javac and preverify are working. But when i go to the directory for the program helloworldplus i am getting 32 errors when i compile!


here is an example... please help i have been trying for 4 days to get going with this!

C:\s60\devices\s60_3rd_MIDP_SDK_FP1\s60examples\helloworldplus\src\com\nokia\mid
p\examples\lcdui\helloworldplus\TextEditor.java:35: cannot find symbol
symbol : variable Command
location: class com.nokia.midp.examples.lcdui.helloworldplus.TextEditor
new Command("Cancel", Command.CANCEL, COMMAND_PRIORITY);
^
C:\s60\devices\s60_3rd_MIDP_SDK_FP1\s60examples\helloworldplus\src\com\nokia\mid
p\examples\lcdui\helloworldplus\TextEditor.java:59: cannot find symbol
symbol : class TextField
location: class com.nokia.midp.examples.lcdui.helloworldplus.TextEditor
textField = new TextField("Edit message",
^
C:\s60\devices\s60_3rd_MIDP_SDK_FP1\s60examples\helloworldplus\src\com\nokia\mid
p\examples\lcdui\helloworldplus\TextEditor.java:62: cannot find symbol
symbol : variable TextField
location: class com.nokia.midp.examples.lcdui.helloworldplus.TextEditor
TextField.ANY);
^
C:\s60\devices\s60_3rd_MIDP_SDK_FP1\s60examples\helloworldplus\src\com\nokia\mid
p\examples\lcdui\helloworldplus\TextEditor.java:68: cannot find symbol
symbol : method setCommandListener(com.nokia.midp.examples.lcdui.helloworldplus
.TextEditor)
location: class com.nokia.midp.examples.lcdui.helloworldplus.TextEditor
setCommandListener(this);
^
37 errors

C:\s60\devices\s60_3rd_MIDP_SDK_FP1\s60examples\helloworldplus\src\com\nokia\mid
p\examples\lcdui\helloworldplus\TextEditor.java:35: cannot find symbol
symbol : variable Command
location: class com.nokia.midp.examples.lcdui.helloworldplus.TextEditor
new Command("Cancel", Command.CANCEL, COMMAND_PRIORITY);
^

The priority is an integer usually in the range of 0-4, that is max what I seen. I tried to look up max value but couldn't find it. Lower number stand for higher priority and higher number for lower priority

C:\s60\devices\s60_3rd_MIDP_SDK_FP1\s60examples\helloworldplus\src\com\nokia\mid
p\examples\lcdui\helloworldplus\TextEditor.java:59: cannot find symbol
symbol : class TextField
location: class com.nokia.midp.examples.lcdui.helloworldplus.TextEditor
textField = new TextField("Edit message",
^

This look like missing import statement import javax.microedition.lcdui.TextField; , or can be wrong spelling in some cases

C:\s60\devices\s60_3rd_MIDP_SDK_FP1\s60examples\helloworldplus\src\com\nokia\mid
p\examples\lcdui\helloworldplus\TextEditor.java:62: cannot find symbol
symbol : variable TextField
location: class com.nokia.midp.examples.lcdui.helloworldplus.TextEditor
TextField.ANY);
^

Missing import

C:\s60\devices\s60_3rd_MIDP_SDK_FP1\s60examples\helloworldplus\src\com\nokia\mid
p\examples\lcdui\helloworldplus\TextEditor.java:68: cannot find symbol
symbol : method setCommandListener(com.nokia.midp.examples.lcdui.helloworldplus
.TextEditor)
location: class com.nokia.midp.examples.lcdui.helloworldplus.TextEditor
setCommandListener(this);
^
37 errors

Difficult to say, can be related to any above errors. If you have problem with the code you can post it bellow I will have look at it. Please use code tags in that case [code] YOUR CODE [/code]

is your classpath set correctly?

is your classpath set correctly?

Why do you think there is a problem with classpath? How did you come up with this conclusion?

Why do you think there is a problem with classpath? How did you come up with this conclusion?

Whoops, I didn't see your post, before I posted mine. Looks like you got it right.

Firstly thanks for the help guys...
This program is one of the default ones that came with s60 and i was just following the instructions to get the thing working, is there something else maybe i have to download to get the mobile stuff working

with 37 errors in the code it feels like i need something else...as opposed to there being actually 37 errors i don't think there is!

/* Copyright © 2006 Nokia. */
package com.nokia.midp.examples.lcdui.helloworldplus;

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

/**
 * This class illustrates the implementation of a simple MIDlet that initially
 * displays a "HelloWorld" message to the screen and allows the user to edit
 * that message.
 * <p>
 * This class extends the class javax.microedition.midlet.MIDlet. It
 * creates and maintains references to a TextScreen object and a
 * TextEditor object.
 * <p>
 * Note that the HelloWorldMIDlet class has no constructor. MIDlet
 * contructors are not required to do anything because intializing of the
 * object is better performed in the startApp() method.
 */
public class HelloWorldPlusMIDlet extends MIDlet {

    /** Displays the message on the screen. */
    private TextScreen textScreen;

    /** Allows the user to edit the message displayed. */
    private TextEditor textEditor;

    /** A generic way of indicating whether startApp() has previously been called. */
    private Display display;

    /**
     * Creates an instance of TextScreen if one has not already been
     * created and tells the framework to set this instance of TextScreen
     * as the current screen.
     */
    public void startApp() {
        if (display == null) {
            // First time we've been called.
            display=Display.getDisplay(this);
            textScreen = new TextScreen(this, "Hello World!");
        }
        display.setCurrent(textScreen);
    }

    /**
     * This must be defined but no implementation is required because the MIDlet
     * only responds to user interaction.
     */
    public void pauseApp() {
    }

    /**
     * No further implementation is required because the MIDlet holds no
     * resources that require releasing.
     *
     * @param unconditional is ignored.
     */
    public void destroyApp(boolean unconditional) {
    }

    /**
     * A convenience method for exiting.
     */
    public void exitRequested(){
        destroyApp(false);

        /*
         * notifyDestroyed() tells the scheduler that this MIDlet is now in a
         * destroyed state and is ready for disposal.
         */
        notifyDestroyed();
    }

    /**
     * Implements the transition from the TextEditor screen to the TextScreen screen.
     *
     * @param string is the new text to be displayed. It is null if the text is
     * not to be changed.
     */
    public void textEditorDone(String string) {
        if (string != null) {
            textScreen.setCurrentText(string);
        }
        display.setCurrent(textScreen);
    }

    /**
     * Implements the transition from the TextScreen screen to the TextEditor screen.
     */
    public void textEditorRequested() {
        String currentText = textScreen.getCurrentText();
        if (textEditor == null) {
            textEditor = new TextEditor(this, currentText);
        } else {
            textEditor.setText(currentText);
        }
        display.setCurrent(textEditor);
    }
}

I'm just downloading Nokia's SDK for S60 as I'm not familiar with it and I will let you know the outcome

What IDE you using NetBEans, Eclipse?

Hey sorry for not getting back sooner peter, i was doing this from the command line but i have eclipse installed.. its i haven't installed the eclipse plugin yet. just wanted to get it working first

I do not have Eclipse I mainly use NetBeans or IntelliJ IDEA. I tested this "helloworldplus", there is NetBeans folder avaialable. Then inside I had to go project Properties and add some optional packages. I haven't got such problem when adding Sony Ericsson instance :-/

ok i'm gonna start from scratch thanks for your help peter

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.