【发布时间】:2014-11-24 00:11:58
【问题描述】:
我正在尝试开发一个 Eclipse 插件。此插件使用 jgit 通过 ssh 使用 ubuntu 用户名和密码来访问 git 存储库。 (Clone git repository over ssh with username and password by Java) 在此与 NetbBeans 一起使用 jgit 效果很好。它可以毫无问题地克隆、提交和推送项目。但是,当我将相同的代码片段移动到 jgit 插件的 Eclipse jsch 中时,我添加到项目中的 jsch 发生冲突。如果我删除了我添加的那个,那么我无法编译代码(我需要在一个类中导入 com.jcraft.jsch.Session)。另一方面,如果添加它,则会出现以下错误
java.lang.LinkageError:
loader constraint violation: loader
(instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader)
previously initiated loading for a different type with name
"com/jcraft/jsch/Session"
有办法摆脱这种混乱吗?
我正在使用 jgit-3.2.0 和 jsch-0.1.5.0 Eclipse 版本是 Kepler。
我的插件清单
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: ****
Bundle-SymbolicName: ****;singleton:=true
Bundle-Version: 1.1.0513
Bundle-Activator: ****.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.ui.browser;bundle-version="3.4.100",
org.eclipse.core.resources;bundle-version="3.8.100",
org.eclipse.ui.ide;bundle-version="3.9.0",
org.eclipse.jdt.core;bundle-version="3.9.0",
org.eclipse.core.filesystem;bundle-version="1.4.0",
org.eclipse.team.core;bundle-version="3.7.0",
org.eclipse.jgit;bundle-version="3.2.0",
org.eclipse.jdt.launching;bundle-version="3.7.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .,
lib/commons-io-2.4.jar,
lib/zip4j_1.3.2.jar,
lib/jsch-0.1.50.jar
【问题讨论】:
标签: eclipse eclipse-plugin osgi osgi-bundle linkageerror