我正在制作一个Eclipse插件。当我在日食RCP中启动它时,一切正常。但是,当我将其作为功能导出并将其安装在标准Eclipse上时,我会收到此错误:
插件foo.bar无法加载类 foo.bar.Editor。
我已经搜索了生成的功能和插件jar,而Editor.class位于bin / foo / bar / Editor.class中。
那么问题是什么?
这是我的插件build.properties:
bin.includes = META-INF/,\
plugin.xml,\
icons/,\
bin/info/
jars.compile.order = cucumber-core-1.2.4.jar,\
cucumber-html-0.2.3.jar,\
cucumber-java-1.2.4.jar,\
cucumber-junit-1.2.4.jar,\
cucumber-jvm-deps-1.0.5.jar,\
gherkin-2.12.2.jar
src.includes = src/,\
icons/,\
plugin.xml,\
META-INF/,\
.project,\
.classpath,\
.settings/,\
build.properties
这是我的MANIFEST.MF
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Cucumber
Bundle-SymbolicName: foo.bar.cucumber;singleton:=true
Bundle-Version: 2.0.0.Final
Bundle-Activator: foo.bar.cucumber.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.jface.text;bundle-version="3.9.2",
org.eclipse.ui.editors;bundle-version="3.8.200",
org.eclipse.swt,
org.eclipse.text,
org.eclipse.osgi,
org.eclipse.equinox.registry,
org.eclipse.jdt.core,
org.eclipse.core.resources,
Cucumber;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Import-Package: cucumber.api.java.fr,
org.eclipse.ui.texteditor,
org.eclipse.ui.texteditor.templates
Export-Package: foo.bar.cucumber,
foo.bar.cucumber.contentAssist,
foo.bar.cucumber.synthaxColoring
我的plugin.xml
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.editors">
<editor
class="foo.bar.cucumber.Editor"
default="false"
extensions="feature"
icon="icons/cukes.gif"
id="foo.bar.cucumber.editor"
name="Cucumber editor">
</editor>
</extension>
<extension
point="org.eclipse.ui.editors.templates">
<contextType
class="org.eclipse.jface.text.templates.TemplateContextType"
id="foo.bar.cucumber.contentAssist.template.contextType"
name="Default Context Type">
</contextType>
<template
autoinsert="true"
contextTypeId="foo.bar.cucumber.contentAssist.template.contextType"
description="Template d'une fonctionnalité"
icon="icons/cukes.gif"
id="foo.bar.cucumber.contentAssist.template.feature"
name="Fonctionnalité">
<pattern>
#language:fr
Fonctionnalité : ${description_de_la_fonctionnalité}
Scénario : ${description_du_scénario}
Soit
Et
Alors
</pattern>
</template>
<template
autoinsert="true"
contextTypeId="foo.bar.cucumber.contentAssist.template.contextType"
description="Template d'un scénario"
icon="icons/cukes.gif"
id="foo.bar.cucumber.contentAssist.template.scenario"
name="Scénario">
<pattern>
Scénario : ${description_du_scénario}
Soit
Et
Alors
</pattern>
</template>
</extension>
</plugin>
答案 0 :(得分:0)
假设您的源代码位于src
文件夹中,输出类位于bin
文件夹中,build.properties
应包含以下内容:
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
icons/,\
plugin.xml
(加上你的jar.compile.order)
如果你想让这些罐子包含在插件中,他们也需要在'bin.includes'中列出。