Just tried your code on my Eclipse setup and it works so I agree it is probably because you have not linked in the OpenGL library jars. This shows my build path -