Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Problem with building Bluetooth project

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

C:\School\Year4\Tech Project\Programs\Bluetooth\FuelFinderBT.java:91: 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

bglodde earned 2000 total points
ID: 16550198
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

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

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

564 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