eclipse magic: ... Syntax error, varargs are only available if source level is 1.5 or greater

Check whether this works:

  1. Go to your project's Properties
  2. On the Properties dialog choose the Java Compiler node in the left tree.
  3. Finally set the Compiler compliance level to 1.5 or more.
  4. Rebuild the project.

Just make sure Java > Installed JREs has jre6 instead of jdk1.6.0

Eclipse seems detect jdk6 as not jre 1.5+


Single answer couldn't solve my problem so I used both :

  • First right click on the error in problems tab
  • click Quick fix
  • ok
  • right click on the project
  • build path
  • configure build path
  • remove JRE library
  • add JRE library

.... tada...done... :)

Tags:

Java

Eclipse