"Couldn't resolve reference to Grammar 'org.eclipse.xtext.common.Terminals'" - PDE 已安装

"Couldn't resolve reference to Grammar 'org.eclipse.xtext.common.Terminals'" - PDE is installed

我正在尝试在 xtext 中创建基本语法,例如下面的默认语法:

grammar x.Y with org.eclipse.xtext.common.Terminals

generate x "http://www.Y.x"

Model:
    greetings+=Greeting*;

Greeting:
    'Hello' name=ID '!';

但是,我收到一个错误:

Couldn't resolve reference to Grammar 'org.eclipse.xtext.common.Terminals'.

网上查了下,建议安装Eclipse Plug-in Development Tools (PDE)。我已经这样做了,但问题仍然存在(清理项目后)。

我也试过RCP Eclipse Nero包,问题依旧。

我已经安装了 Java SE 1.8,我正在使用 Eclipse Nero(RCP 和非 RCP)。

我在网上找不到更多建议,唯一的建议似乎是确保安装了 PDE。有什么想法吗?

更新

在项目设置中设置了默认值。

项目结构截图:

主要问题如下:

Description Resource Path Location Type Bundle 'org.eclipse.equinox.common' cannot be resolved MANIFEST.MF /org.xtext.example.mydsl/META-INF line 10 Plug-in Problem Bundle 'org.eclipse.ui.editors' cannot be resolved MANIFEST.MF /org.xtext.example.mydsl.ui/META-INF line 13 Plug-in Problem Bundle 'org.eclipse.ui.ide' cannot be resolved MANIFEST.MF /org.xtext.example.mydsl.ui/META-INF line 14 Plug-in Problem Bundle 'org.eclipse.xtext.ide' cannot be resolved MANIFEST.MF /org.xtext.example.mydsl.ide/META-INF line 9 Plug-in Problem Bundle 'org.eclipse.xtext.junit4' cannot be resolved MANIFEST.MF /org.xtext.example.mydsl.ui.tests/META-INF line 12 Plug-in Problem Bundle 'org.eclipse.xtext.testing' cannot be resolved MANIFEST.MF /org.xtext.example.mydsl.tests/META-INF line 10 Plug-in Problem Bundle 'org.eclipse.xtext.testing' cannot be resolved MANIFEST.MF /org.xtext.example.mydsl.ui.tests/META-INF line 10 Plug-in Problem Bundle 'org.eclipse.xtext.ui.codetemplates.ui' cannot be resolved MANIFEST.MF /org.xtext.example.mydsl.ui/META-INF line 12 Plug-in Problem Bundle 'org.eclipse.xtext.ui.shared' cannot be resolved MANIFEST.MF /org.xtext.example.mydsl.ui/META-INF line 11 Plug-in Problem Bundle 'org.eclipse.xtext.ui' cannot be resolved MANIFEST.MF /org.xtext.example.mydsl.ui/META-INF line 10 Plug-in Problem Bundle 'org.eclipse.xtext.xbase.ide' cannot be resolved MANIFEST.MF /org.xtext.example.mydsl.ide/META-INF line 10 Plug-in Problem Bundle 'org.eclipse.xtext.xbase.junit' cannot be resolved MANIFEST.MF /org.xtext.example.mydsl.ui.tests/META-INF line 13 Plug-in Problem Bundle 'org.eclipse.xtext.xbase.testing' cannot be resolved MANIFEST.MF /org.xtext.example.mydsl.tests/META-INF line 11 Plug-in Problem Bundle 'org.eclipse.xtext.xbase.testing' cannot be resolved MANIFEST.MF /org.xtext.example.mydsl.ui.tests/META-INF line 11 Plug-in Problem Bundle 'org.eclipse.xtext.xbase' cannot be resolved MANIFEST.MF /org.xtext.example.mydsl/META-INF line 9 Plug-in Problem Bundle 'org.eclipse.xtext' cannot be resolved MANIFEST.MF /org.xtext.example.mydsl/META-INF line 8 Plug-in Problem Bundle 'org.junit' cannot be resolved MANIFEST.MF /org.xtext.example.mydsl.tests/META-INF line 9 Plug-in Problem Bundle 'org.junit' cannot be resolved MANIFEST.MF /org.xtext.example.mydsl.ui.tests/META-INF line 9 Plug-in Problem Bundle com.ibm.icu cannot be resolved build.properties /org.xtext.example.mydsl line 19 Plug-in Problem Bundle org.apache.commons.logging cannot be resolved build.properties /org.xtext.example.mydsl line 17 Plug-in Problem Bundle org.apache.log4j cannot be resolved build.properties /org.xtext.example.mydsl line 18 Plug-in Problem Bundle org.eclipse.emf.codegen.ecore cannot be resolved build.properties /org.xtext.example.mydsl line 12 Plug-in Problem Bundle org.eclipse.emf.mwe.utils cannot be resolved build.properties /org.xtext.example.mydsl line 13 Plug-in Problem Bundle org.eclipse.emf.mwe2.launch cannot be resolved build.properties /org.xtext.example.mydsl line 14 Plug-in Problem Bundle org.eclipse.emf.mwe2.lib cannot be resolved build.properties /org.xtext.example.mydsl line 15 Plug-in Problem Bundle org.eclipse.xtext.common.types cannot be resolved build.properties /org.xtext.example.mydsl line 10 Plug-in Problem Bundle org.eclipse.xtext.xbase cannot be resolved build.properties /org.xtext.example.mydsl line 9 Plug-in Problem Bundle org.eclipse.xtext.xtext.generator cannot be resolved build.properties /org.xtext.example.mydsl line 11 Plug-in Problem Bundle org.objectweb.asm cannot be resolved build.properties /org.xtext.example.mydsl line 16 Plug-in Problem Couldn't resolve reference to Grammar 'org.eclipse.xtext.common.Terminals'. MyDsl.xtext /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 1 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/MyDsl.xtext Grammar Problem Couldn't resolve reference to JvmIdentifiableElement 'baseName'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 13 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'code'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 26 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'component'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 10 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'configuration'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 11 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'createEclipseMetaData'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 24 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'eclipsePlugin'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 18 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'eclipsePluginTest'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 21 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'enabled'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 16 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'enabled'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 19 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'enabled'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 22 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'encoding'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 27 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'fileExtensions'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 34 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'fileHeader'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 29 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'generateStub'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 37 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'language'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 32 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'lineDelimiter'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 28 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'name'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 33 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'project'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 12 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'rootPath'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 14 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'runtimeTest'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 15 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'serializer'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 36 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmIdentifiableElement 'validator'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 39 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmType 'StandardLanguage'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 32 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmType 'StandardProjectConfig'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 12 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmType 'Workflow'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 8 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem Couldn't resolve reference to JvmType 'XtextGenerator'. GenerateMyDsl.mwe2 /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 10 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/GenerateMyDsl.mwe2 MWE2 Problem ID cannot be resolved to a rule MyDsl.xtext /org.xtext.example.mydsl/src/org/xtext/example/mydsl line: 9 /org.xtext.example.mydsl/src/org/xtext/example/mydsl/MyDsl.xtext Grammar Problem No available bundle exports package 'org.apache.log4j' MANIFEST.MF /org.xtext.example.mydsl.ui/META-INF line 15 Plug-in Problem

确保您的目标平台没有损坏或丢失:Window -> 首选项 -> 搜索 "Target Platform"