Problem getting the resolution

Hi there,
I am trying to get the Pong example from shakebox.org to work but have problems with this part.

I get the following errors (In Eclipse):
[] Syntax error on token “)”, : expected BasicGame.java GLPong line 30
[
] Syntax error on token(s), misplaced construct(s) BasicGame.java GLPong line 30


      public BasicGame()
      {
            try
            {
                    // Create the windowed OpenGL window at location (50,50), size 800x600 and 16bit depth.
                  DisplayMode modes[] = Display.getAvailableDisplayModes();


(The next is line 30)

                  for(DisplayMode currentMode : modes)
                  {
                        if(currentMode.getWidth() == 800 &&
                           currentMode.getHeight() == 600 &&
                           currentMode.getBitsPerPixel() == 16)
                        {
                              Display.setDisplayMode(currentMode);
                              break;
                        }
                  }

                  Display.setTitle("LWJGL Game Example");
                  Display.setFullscreen(false);
                  Display.setLocation(50, 50);
                  Display.create();
            }
            catch(Exception e)
            {
                  System.err.println("Failed to create OpenGL due to " + e);
                  System.exit(1);
            }
      }

You need to compile with java 1.5.

looks like 1.5 code - need to compile with that enabled “-source 1.5”