实例化eclipse插件时的ClassNotFoundException [英] ClassNotFoundException when instantiating an eclipse plugin

查看:1118
本文介绍了实例化eclipse插件时的ClassNotFoundException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个eclipse插件,我试图将它安装在另一个eclipse的实例上。
当我作为eclipse应用程序运行/调试我的插件时,一切正常。只有在我通过我创建的更新站点安装插件之后,才会出现此问题。



我创建了一个非常简单的更新站点,其中包含一个包含我的插件的单一功能。使用更新站点安装后,我可以在eclipse安装目录下的插件目录中看到我的插件,它正确地包含了应该在那里的所有数据(我想)。然而,当我实例化插件(通过点击我定义的键绑定),我得到一个ClassNotFoundException为主要的插件类,我创建的一个,可以在 bin中找到目录



似乎 bin 目录不知道是一个搜索的地方对于类,但我认为它应该作为插件安装的一部分被添加到eclipse类路径。



我对这个有所了解,发现了许多相关的问题,没有一个是我的具体情况。我会感谢任何建议!

解决方案

当您创建插件时,其他插件只能访问在Export- Manifest.mf的包装部分打开plugin.xml编辑器并查看运行时选项卡 - 它需要将您的程序包列出。这样的一个例子:




I developed an eclipse plugin and I'm trying to install it on another instance of eclipse. When I run/debug my plugin as an eclipse application everything works correctly. The problem occurs only after I install the plugin through the update site I created.

I created a very simple update site which includes a single feature with my plugin packaged in it. After installing using the update site I can see my plugin in the plugin directory under the eclipse install dir and it correctly contains all the data that should be in there (I think). However, when I instantiate the plugin (by hitting the key-binding I defined) I get a ClassNotFoundException for the main plugin class, one that I created and that can be found in the bin directory of my plugin.

It seems that the bin directory is somehow not recognized as a place to search for classes, but I assume that it should be added to the eclipse classpath as part of the plugin installation.

I googled quite a bit about this and found many related problems, none of which was quite hitting my specific situation. I would appreciate any suggestion!

解决方案

When you create a plugin other plugins can only access the classes in packages declared in the Export-Package section of the Manifest.mf. Open the plugin.xml editor and look at the 'Runtime' tab - it needs to have your package listed. Something like this:

这篇关于实例化eclipse插件时的ClassNotFoundException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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