Eclipse插件项目与其他项目依赖关系 [英] Eclipse Plugin project with other project dependencies

查看:658
本文介绍了Eclipse插件项目与其他项目依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Eclipse插件项目,它取决于我在我的Eclipse工作区中的其他项目。在Java构建路径 - >项目选项卡中添加项目依赖关系后,还可以在订单和导出中选择项目,我将获得一个java.lang.NoClassDefFoundError。


$ b $我假设其他项目没有被正确地包含在插件中。有没有人知道如何解决这个问题?



谢谢,
James

解决方案

Eclipse插件项目管理依赖关系与常规Java项目不同。



我假设您正在添加包含.class文件的包。 / p>

在Eclipse插件项目中定义一个库文件夹。将任何外部类和/或jar复制到库文件夹。



打开META-INF目录下的MANIFEST.MF文件。您将看到一个格式化的编辑器,底部有8个选项卡。



单击运行时选项卡。将库文件夹中的外部类和/或jar添加到Classpath。这也将把这些外部类和/或jar添加到项目的Java构建路径。



单击依赖关系选项卡,并在导入的包中添加其他Java项目对话。您必须选中标有显示未导出的软件包的框。如果您的其他Java项目是Eclipse插件,请将其添加到必需插件下。


I have an Eclipse plugin project, and it depends on other projects that I have in my Eclipse workspace. After adding the project dependencies under "Java Build Path" -> "Projects" tab, and also selecting the project in the "Order and Export" I get a java.lang.NoClassDefFoundError.

I'm assuming that the other projects have not been properly included into the plugin. Does anyone know how to fix this?

Thanks, James

解决方案

An Eclipse plug in project manages dependencies differently than a regular Java project.

I'm assuming that you're adding packages with .class files.

Define a library folder in your Eclipse plug-in project. Copy any external classes and / or jars to the library folder.

Open up the MANIFEST.MF file under the META-INF directory. You'll see a formatted editor with 8 tabs on the bottom.

Click on the Runtime tab. Add the external classes and / or jars in the library folder to the Classpath. This will also add these external classes and or jars to the Java Build Path of the project.

Click on the Dependencies tab, and add the other Java projects in the Imported Packages dialog. You have to check the box labeled "Show non-exported packages". If your other Java projects are Eclipse plug ins, add them under Required Plug-ins instead.

这篇关于Eclipse插件项目与其他项目依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆