2

Why do I get 'annotations are not supported in -source 1.3' and 'generics are not supported in -source 1.3' even though I use jdk 1.6? I even checked the Build Path which points to jdk 1.6

FYI: Java Home: C:\Program Files\Java\jdk1.6.0_45\

and I use Eclipse Indigo and I don't have 1.3 at all in my machine.

Thanks.

Rohit Jain
  • 209,639
  • 45
  • 409
  • 525
james2611nov
  • 473
  • 2
  • 10
  • 27

1 Answers1

5

Eclipse comes with it's own compiler. It doesn't uses the environment variable you set on your machine, but just uses it's own project specific Build Path.

You need to set the Compiler compliance level to at least Java 5. Follow the below path to set the level:

Windows -> Preferences -> Java -> Compiler

There, set the compiler compliance level from drop-down.

Rohit Jain
  • 209,639
  • 45
  • 409
  • 525
  • This gets me all the time when I work on projects still using older versions of Java. Not only does the JRE have to be configured in "Installed JREs" but the compliance level must be set to match. Upvoted for concise yet insightful answer. –  Sep 27 '13 at 19:53
  • @RohitJain I did what you suggested. I have 1.6 in that path. Even the installed JREs show jdk1.6.0_45\jre . But I still encounter that problem. I even tried a complete new checkout from SVN. Still has the same problem on my machine but works fine for others. Any other ideas? – james2611nov Oct 09 '13 at 15:09