无法在Eclipse插件开发中使用POI HSSF库
我正在开发一个 Eclipse 插件来创建 Excel 文件并对其执行操作,但我无法使用 POI HSSF 库来实现同样的功能。 我已经下载了poi-3.7-20101029.jar文件。当我尝试通过将其添加到配置构建路径中来在独立的 java 应用程序中使用它时,事情就成功了。但是,当我在 Eclipse PDE 中开发插件期间尝试使用相同的方法时,我得到了 HSSFWorkbook 类的 NoClassDefFound 异常。我已在构建路径中添加了 POI 插件(并确认该插件包含 HSSFWorkbook 类)并导入了 HSSFWorkbook 类。
有人可以告诉我我在这里做错了什么吗?在插件开发中使用POI库时还需要添加或修改什么吗?我应该将库添加为清单文件中的依赖项吗?
谢谢和问候...
Swaraj
I am developing an Eclipse plugin to create and perform operations on excel files and I am not able to use the POI HSSF library for the same.
I have downloaded the poi-3.7-20101029.jar file. When I tried using this in an independent java application by adding it in the configure build path, the thing worked. But when I tried using the same during developing the plugin in the Eclipse PDE, I get a NoClassDefFound exception for the HSSFWorkbook class. I have added the POI plugin in the build path (and confirmed that the plugin contains the HSSFWorkbook class) as well as imported the HSSFWorkbook class.
Could someone tell me what I am doing wrong here? Is there something else I need to add or modify while using the POI library in plugin development? Should I add the library as dependencies in the Manifest file?
Thanks and Regards...
Swaraj
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要将库添加到插件类路径中。为此,请打开 MANIFEST.MF 并选择“运行时”选项卡。然后,在“类路径”部分中,单击“添加”按钮。将打开一个对话框,从那里选择您的 jar。
You need to add the library to the plugin classpath. To do this, open your MANIFEST.MF and select the tab "Runtime". Then, in the "Classpath" section, click on the "Add" button. A dialog will open up, select your jar from there.