[英]Eclipse PDE: Syntax error, type annotations are available only when source level is at least 1.8
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. 我有数百个相同的错误:
Syntax error, type annotations are available only when source level is at least 1.8
在安装WindowBuilder Eclipse插件后Syntax error, type annotations are available only when source level is at least 1.8
。 My setup is with Java 7, and I cannot upgrade to Java 8 yet. 我的设置是使用Java 7,但我还无法升级到Java 8。 I have Java 7 and 8 installed, but my JRE and compiler are set to Java 7 via
Window > Preferences > Java
. 我安装了Java 7和8,但我的JRE和编译器通过
Window > Preferences > Java
设置为Java 7。
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 我相信我发现了这个问题,它与
org.eclipse.jdt.annotation
插件相关,如下所述: 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
. 我注意到我现在有两个
org.eclipse.jdt.annotation
插件,版本1.1.0
和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
. 问题是
2.0.0
依赖于Java 1.8,我的所有插件都引用了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: 以下是我试图引用
1.1.0
捆绑版本的摘录:
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. 更新是的,我正在运行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.
谢谢。
Big thanks to @greg-449 for bringing up the suggestion mentioned in the bug report, the credit goes to him. 非常感谢@ greg-449提出错误报告中提到的建议,归功于他。 I am posting this answer for completeness and to help others:
我发布这个答案是为了完整性并帮助其他人:
Yes, I am running Luna. 是的,我正在运行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. 错误消失了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.