Results 1 to 2 of 2
  1. #1
    gunwantw is offline Member
    Join Date
    Jul 2010
    Posts
    1
    Rep Power
    0

    Exclamation Syntax error in eclipse for "enum" defination.

    Hi all, I am very new to eclipse.
    I am using eclipse Version: 3.5.0 Build id: I20090611-1540 which i have just downloaded form download page.

    I have a enum deceleration in one of my java file as follows.

    enum OS{
    Linux ("\\$\\{staging\\}\\/disa-linux-sensors","LinuxSensors.txt"),
    HPUX ("\\$\\{staging\\}\\/disa-hpux-sensors","HPUXSensors.txt"),
    AIX ("\\$\\{staging\\}\\/disa-aix-sensors","AIXSensors.txt"),
    SunOS ("\\$\\{staging\\}\\/disa-solaris-sensors","SolarisSensors.txt");

    private String pattern;
    private String sensorsFile;


    public String getPattern(){return pattern;}
    public String getSensorsFile(){return sensorsFile;}

    OS(String pattern,String sensorsFile){

    this.pattern=pattern;
    this.sensorsFile=sensorsFile;
    }
    }

    For this code i am getting following syntax error at lines with red color.


    Multiple markers at this line
    - Return type for the method is missing
    - Syntax error on tokens, delete these
    tokens
    at deceleration of Linux,AIX,HPUX,SunOS enum types.

    Where as this get compiled successfully form my ant builder.
    My Compiler compliance level is 1.5.

    please suggest me if i am missing any preferences or anything else.

    Thanks

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,375
    Blog Entries
    7
    Rep Power
    20

    Default

    Strange, it works for me (compliance settings 1.6); I suspect that some lines *before* the enum declaration something is happening ...

    kind regards,

    Jos

Similar Threads

  1. Replies: 1
    Last Post: 11-20-2009, 07:58 PM
  2. Syntax error on token "(", ; expected
    By baltimore in forum AWT / Swing
    Replies: 3
    Last Post: 10-28-2009, 12:19 AM
  3. Syntax error on token "(", ; expected
    By romilc in forum New To Java
    Replies: 7
    Last Post: 10-24-2009, 01:23 AM
  4. Unfamiliar Syntax "int x = i1 << 24 | i2 ..."
    By KentDMc in forum New To Java
    Replies: 5
    Last Post: 04-11-2009, 03:21 AM
  5. Replies: 1
    Last Post: 10-20-2008, 07:35 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •