我知道关于这个主题还有其他问题,但我都试过了,但对我没有用。我想从我的 rcp 插件中将一些输出写入 excel 文件,但它显示:
java.lang.NoClassDefFoundError: org/apache/poi/hssf/usermodel/HSSFWorkbook
所以我这样做:plugin.xml->runtime tab-> add the poi jars in the classpath section
。
但是当我尝试运行时,它显示:
org.osgi.framework.BundleException: The activator spyros.getInfo.Activator for
bundle spyros.getInfo is invalid.
我的问题:
- 我是否必须将 poi jar 放在特定文件夹中(例如 META-INF 文件夹中),然后将它们添加到类路径中?
- 如何修复激活器错误?
我的清单.MF
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: GetInfo
Bundle-SymbolicName: spyros.getInfo; singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: spyros.getInfo.Activator
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.jdt.core;bundle-version="3.7.1",
org.eclipse.core.resources;bundle-version="3.7.100",
org.eclipse.ui,
org.eclipse.jdt.ui;bundle-version="3.7.1"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.apache.commons.collections
Bundle-ClassPath: lib/poi-3.8-20120326.jar,
lib/poi-examples-3.8-20120326.jar,
lib/poi-excelant-3.8-20120326.jar,
lib/poi-ooxml-3.8-20120326.jar,
lib/poi-ooxml-schemas-3.8-20120326.jar,
lib/poi-scratchpad-3.8-20120326.jar
我的构建属性
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
icons/,\
lib/poi-3.8-20120326.jar,\
lib/poi-examples-3.8-20120326.jar,\
lib/poi-excelant-3.8-20120326.jar,\
lib/poi-ooxml-3.8-20120326.jar,\
lib/poi-ooxml-schemas-3.8-20120326.jar,\
lib/poi-scratchpad-3.8-20120326.jar
我的插件.xml
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.commands">
<command
defaultHandler="spyros.getInfo.handlers.GetInfo"
id="spyros.getInfo.commands.GetInfo"
name="GetInfo">
</command>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="menu:org.eclipse.ui.main.menu">
<menu
id="spyros.getInfo.commands.GetInfo"
label="My Info">
<command
commandId="spyros.getInfo.commands.GetInfo"
label="Get Info"
style="push"
tooltip="Get Info from methods">
</command>
</menu>
</menuContribution>
</extension>
</plugin>
我很困惑,但我相信 stackoverflow 社区会有所帮助,因为你是最棒的!提前谢谢!