gpt4 book ai didi

java - jackcess 中的 NoClassDefFoundError

转载 作者:行者123 更新时间:2023-12-01 11:38:09 24 4
gpt4 key购买 nike

我正在开发一个基于 eclipse 插件的 RCP 应用程序。在我的一个插件项目中,我添加另一个插件项目作为依赖项。假设项目 A 将项目 B 作为其 list 下定义的依赖项。项目 B 包含 jackcess.jar 文件作为引用库。

在项目 B 中,我有一个名为 Mirror.java 的类

 public Mirror(String source, String template, String target) throws SQLException, IOException {
this.sourceString=source;
this.templateFileString=template;
this.targetFileString=target;
}

当我尝试创建 Mirror 类的对象时,在项目 A 内部

 Mirror  m = new Mirror(connectionString, "EABase_JET4_empty.eap",platformDB.getAbsolutePath());

我收到以下错误

java.lang.NoClassDefFoundError: com/healthmarketscience/jackcess/ImportFilter

项目B的build.properties(包含jackcess.jar)

bin.includes = META-INF/,\
src/main/resources/lib/jackcess-1.2.6.af3.jar

MANIFEST.MF

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: MirrorDbToEap
Bundle-SymbolicName: MirrorDbToEap
Bundle-Version: 1.0.0
Export-Package: .,
com.example.jetdb.mirror
Require-Bundle: CommonsIo;bundle-version="2.0.0",
org.apache.commons.lang;bundle-version="2.6.0",
org.apache.commons.logging;bundle-version="1.0.4"

Image有人知道这里出了什么问题吗?

谢谢

最佳答案

您没有将 jackcess.jar 包含在 build.properties 文件的 bin.includes 中,因此它不会包含在 RCP 构建中。

打开 build.properties 编辑器并在“二进制构建”选项中选择 jar。

该 jar 还必须出现在 MANIFEST.MF 的 Bundle-ClassPath 中。在“运行时”选项卡的 list 编辑器中,将 jar 添加到“类路径”部分(对于普通插件代码,还应该有“.”)。

关于java - jackcess 中的 NoClassDefFoundError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29794018/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com