Problem with building Bluetooth project

Posted on 2006-04-25
Last Modified: 2008-02-01
I get this error when I try and build my project.

C:\School\Year4\Tech Project\Programs\Bluetooth\ constant expression required
            case SERVER_PORT: {
1 error
Error!: Error: java compiler failed: javac -source 1.3 -target 1.1 -g -O -d C:\DOCUME~1\Chris\LOCALS~1\Temp\rapc_53dd4af3.dir -bootclass ...

I can't figure out what it means. I even re wrote it to match a smaple from that comes with JDE 4.1

This is the code that has the error:

            case SERVER_PORT: {
                //Push a new SPPScreen onto the display stack and pop the existing menu
                pushScreen( new SPPScreen(null) );
                if( cookie instanceof Runnable ) {

How can I fix this problem?
Question by:TheMeeser
    LVL 13

    Accepted Solution

    This is a requirement for the switch statement ~ it's a complicated explanation why (see the JLS, it goes into great detail with this scenario).
    In short, for this to work correctly, somewhere in your code, you need to have:
    final static int SERVER_PORT = 80;  // or whatever server port you need to refer to.

    Author Comment

    Thank you. I did not realize that the SERVER_PORT had to have final in it.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    When a user’s mailbox is first created and his Blackberry account enabled how do we provision the device and what happens in the background? Stage 1 – Activation The user of the BlackBerry device types the email address and activation password i…
    I felt secure communicating on the BBM... Till some time back!! It was probably the fact that the BBM messages do not travel over the internet was making me feel 'secure' about it, or was it the fact that BBM only works on a BlackBerry Devices a…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now