Annotations are available only for java 1.5 and higher when creating the backend Google App Engine (JDK 1.8, new ADT)

I installed the new ADT: http://developer.android.com/sdk/index.html?hl=sk Then I installed:

enter image description here

When I got into the readme directory of Eclipse, there are:

Eclipse Project Release Notes

Version 4.3.0 Last updated May 29, 2013

I created a new Android application, then right-click on it -> Google-> Generated the backend of the Google App Engine application, and this is what I got:

Description Resource Path Location Type The import android.os.Build is never used MainActivity.java /A/src/com/uniquebullshit/a line 12 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater MessageData.java /A-AppEngine/src/com/uniquebullshit/a line 22 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 21 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater MessageData.java /A-AppEngine/src/com/uniquebullshit/a line 28 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 21 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater MessageData.java /A-AppEngine/src/com/uniquebullshit/a line 29 Java Problem The import android.support.v7.app.ActionBar is never used MainActivity.java /A/src/com/uniquebullshit/a line 4 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater DeviceInfo.java /A-AppEngine/src/com/uniquebullshit/a line 25 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater DeviceInfo.java /A-AppEngine/src/com/uniquebullshit/a line 33 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater MessageEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 46 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater MessageEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 46 Java Problem Syntax error, parameterized types are only available if source level is 1.5 or greater MessageEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 98 Java Problem The method setMaxResults(int) in the type Query is not applicable for the arguments (Integer) MessageEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 95 Java Problem Syntax error, parameterized types are only available if source level is 1.5 or greater MessageEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 112 Java Problem Syntax error, 'for each' statements are only available if source level is 1.5 or greater MessageEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 105 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater MessageEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 127 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater MessageEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 126 Java Problem The method listDeviceInfo(String, Integer) in the type DeviceInfoEndpoint is not applicable for the arguments (null, int) MessageEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 142 Java Problem Syntax error, parameterized types are only available if source level is 1.5 or greater MessageEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 142 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater MessageEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 74 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater MessageEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 73 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater MessageEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 76 Java Problem Syntax error, parameterized types are only available if source level is 1.5 or greater MessageEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 75 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater MessageEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 77 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater MessageEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 76 Java Problem Syntax error, parameterized types are only available if source level is 1.5 or greater MessageEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 81 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater MessageEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 77 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 140 Java Problem Type mismatch: cannot convert from Object to DeviceInfo DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 143 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 119 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 139 Java Problem Type mismatch: cannot convert from Object to DeviceInfo DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 154 Java Problem There was a problem generating the API metadata for your Cloud Endpoints classes: com.google.api.server.spi.config.ApiConfigException: class com.uniquebullshit.a.MessageEndpoint has no @Api annotation. A-AppEngine Unknown Google App Engine Cloud Endpoints Problem Marker Type mismatch: cannot convert from element type Object to DeviceInfo MessageEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 144 Java Problem Syntax error, 'for each' statements are only available if source level is 1.5 or greater MessageEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 144 Java Problem Syntax error, parameterized types are only available if source level is 1.5 or greater DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 33 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 34 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 31 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 32 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 35 Java Problem Syntax error, parameterized types are only available if source level is 1.5 or greater DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 39 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 34 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 35 Java Problem Syntax error, 'for each' statements are only available if source level is 1.5 or greater DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 60 Java Problem Syntax error, parameterized types are only available if source level is 1.5 or greater DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 65 Java Problem The method setMaxResults(int) in the type Query is not applicable for the arguments (Integer) DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 51 Java Problem Syntax error, parameterized types are only available if source level is 1.5 or greater DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 54 Java Problem Type mismatch: cannot convert from Object to DeviceInfo DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 82 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 97 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 77 Java Problem Syntax error, annotations are only available if source level is 1.5 or greater DeviceInfoEndpoint.java /A-AppEngine/src/com/uniquebullshit/a line 78 Java Problem 

How to deal with this? EDIT:

enter image description here

+7
java android eclipse google-app-engine
source share
5 answers

I tried below and it helped.

  • Check the Use default compliance settings box as in the highlighted section (blue color) of the image below.
  • If this does not help, try changing the Compiler compliance level to another level, press the Apply key, and then again.

enter image description here

+12
source share

For me, the Enable project settings check box is not selected. I selected it and cleared the project through the Project menu.

+3
source share

The answer mentioned by Stultuske in [ eclipse magic: ... Syntax error, varargs is only available if the source level is 1.5 or more . >

On mac os x

  • Install Java 6 JDK
  • Go to Eclipse> Preferences
  • Choose Add ... from Java> Installed JREs, then Standard Virtual Machine and select the directory /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home as the home JRE, then Done, Ok
+2
source share

Had a similar problem.

I checked the Java version of the JDK in the Java Build Path section.

I checked the match levels in the Java Compiler section.

I looked through Project Facets and saw that Java is not being tested. Checking this resolved the problem (after restoring the project).

enter image description here

+1
source share

make sure the source level is 1.5 or higher. it looks like you are using an older version of the JDK.

0
source share

All Articles