4

I am having hundreds of the same error: Syntax error, type annotations are available only when source level is at least 1.8 after installing the WindowBuilder Eclipse plug-in. My setup is with Java 7, and I cannot upgrade to Java 8 yet. I have Java 7 and 8 installed, but my JRE and compiler are set to Java 7 via Window > Preferences > Java.

I believe that I found the problem, which is related to the org.eclipse.jdt.annotation plug-in, described here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=434033

Any suggestions on how to fix this problem?

I noticed that I now have two org.eclipse.jdt.annotation plug-ins, versions 1.1.0 and 2.0.0. The problem is that 2.0.0 has a dependency on Java 1.8, and all of my plugins are referencing 2.0.0. I believe that changing these references to the earlier version should solve this, correct? How can I do this?

As a test, I altered my manifest file on one of my plug-in projects, but it does not remove the errors. Here is an excerpt where I tried to reference the 1.1.0 bundle version:

Require-Bundle: org.eclipse.ui,
 org.eclipse.core.resources,
 org.eclipse.core.runtime,
 org.eclipse.jdt.core,
 org.eclipse.ltk.core.refactoring,
 org.eclipse.jdt.ui,
 com.kivancmuslu.www.solstice.common,
 com.kivancmuslu.www.util.eclipse,
 com.kivancmuslu.www.util.eclipse.ui,
 org.eclipse.ui.workbench.texteditor,
 org.eclipse.ui.ide,
 org.eclipse.ui.editors,
 org.eclipse.jface.text,
 com.kivancmuslu.www.utils,
 org.eclipse.ui.console,
 org.eclipse.jdt.annotation;bundle-version="1.1.0"

UPDATE Yes, I am running Luna. After changing the last line of my manifest from

 org.eclipse.jdt.annotation;bundle-version="1.1.0"

to

 org.eclipse.jdt.annotation;bundle-version="[1.1.0,2.0.0)"

the errors are gone. Thank you.

5
  • 1
    The bug report is for Eclipse 4.4 (Luna) - is that what you are running? Commented May 13, 2014 at 10:49
  • 2
    As suggested in the bug report use [1.1.0,2.0.0) for the bundle-version on the annotation plugin. Commented May 13, 2014 at 10:51
  • Thank you for the tip. I updated my question above, but is there a way to update the references to org.eclipse.jdt.annotation for all of my plug-in manifests in one edit? Commented May 13, 2014 at 10:59
  • 1
    You could probably use Search > File Search with the Replace... button. Commented May 13, 2014 at 11:26
  • confirmed, force-using version 1.1.0 of eclipse's annotation jar solves this problem (I also must use Java 7 for this project). Commented Feb 6, 2015 at 1:22

1 Answer 1

1

Big thanks to @greg-449 for bringing up the suggestion mentioned in the bug report, the credit goes to him. I am posting this answer for completeness and to help others:


Yes, I am running Luna. After changing the last line of my manifest from

 org.eclipse.jdt.annotation;bundle-version="1.1.0"

to

 org.eclipse.jdt.annotation;bundle-version="[1.1.0,2.0.0)"

the errors are gone.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.