基于此simple tutorial,我试图显示弹出窗口通知,作为org.eclipse.mylyn.commons.ui依赖项的一部分。所以我已经将这个依赖项添加到我的plugin.xml中了:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Roll and Scroll Recorder
Bundle-SymbolicName: ATF_Recorder_Plugin;singleton:=true
Bundle-Version: 0.0.502
Bundle-Activator: com.jcraft.eclipse.jcterm.JCTermPlugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
com.jcraft.jsch;bundle-version="0.1.31",
org.eclipse.core.resources;bundle-version="3.7.101",
org.eclipse.jsch.core;bundle-version="1.1.300",
com.jcraft.eclipse.jsch.core,
org.eclipse.mylyn.commons.ui;bundle-version="3.6.1"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: OSEHRA
此外,我在Feature项目中单击了计算依赖项,现在将其更新到我的feature.xml文件中:
<requires>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.runtime"/>
<import plugin="com.jcraft.jsch" version="0.1.31" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.resources" version="3.7.101" match="greaterOrEqual"/>
<import plugin="org.eclipse.jsch.core" version="1.1.300" match="greaterOrEqual"/>
<import plugin="com.jcraft.eclipse.jsch.core"/>
<import plugin="org.eclipse.mylyn.commons.ui" version="3.6.1" match="greaterOrEqual"/>
</requires>
然而,当我安装自定义插件并去显示它的视图时,依赖关系永远不会得到解决:
java.lang.ClassNotFoundException: org.eclipse.mylyn.internal.provisional.commons.ui.AbstractNotificationPopup
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClassHoldingLock(ClasspathManager.java:626)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:601)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:562)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:486)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:459)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.jcraft.eclipse.jcterm.JCTermView.createPartControl(JCTermView.java:189)
at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:375)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:229)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
at org.eclipse.ui.internal.Perspective.showView(Perspective.java:2245)
...
答案 0 :(得分:1)
这个问题的教训是
Don't ever use non-API classes, unless you don't care if your plug-in breaks in future versions
。
如果你绝对需要向后兼容,我想你必须两次构建你的插件。
但是,因为
您可能最需要org.eclipse.mylyn.commons.ui
,版本3.7及更高版本。
由于您使用Eclipse 3.6进行开发,因此您必须设置一个包含3.7安装的目标平台。
答案 1 :(得分:0)
您确定要针对您构建的mylyn版本运行插件吗?在较新版本的mylyn(例如3.8.0)中,该类已移至包org.eclipse.mylyn.commons.ui.dialog
。
答案 2 :(得分:0)
问题:即使使用了“相同”的Indigo SR 2版本的Eclipse,它们也不相同。他们中的一些有3.6版org.eclipse.mylyn.commons.ui
其他有3.8(这应该只在Juno ...)。