NoClassDefFoundError的导入库项目 [英] NoClassDefFoundError importing a library project

查看:263
本文介绍了NoClassDefFoundError的导入库项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在写使用的版本4.6.1(Windows Vista中的Eclipse +)一个单元测试项目。我的项目是在第3部分分为:

I'm currently writing a unit test project using the version 4.6.1 (Windows Vista + Eclipse). My project is divided in 3 part:


  • 系统。单元测试的应用程序(类型:CLDC应用程序)

  • 乙。被测试的应用程序(类型:CLDC应用程序)

  • ℃。库项目(类型:图书馆,没有.jar文件导入)

在一个项目应该引用code present在B(当然,即使在C)。我想指定我可以运行没有问题的项目B(参考C)。当我尝试运行项目中的我的问题开始。

The A project should reference the code present in B (and of course even in C). I would like to specify that I can run without problems the project B (referencing C). My problems start when I try to run the project A.

我执行的以下操作:

改变从CLDC应用程序库中的B类项目类型
b号项目Ç
A引用了B项目
将所有项目作为活动为黑莓
基本上是看到其他两个项目作为两个嵌套库。
在code构建成功,但问题是,当一个类C库是由B中的执行过程中调用,下面抛出异常:

changing the B project type from CLDC application to library B references the project C A references the project B set all project as "Active for Blackberry" Basically A sees the two other project as two nested libraries. The code is built successfully,but the problem is that when a class of the C library is called by B during the execution, the following exception is thrown:

的NoClassDefFoundError

NoClassDefFoundError

没有详细消息

任何帮助将是非常美联社preciated。

Any help would be really appreciated.

非常感谢

推荐答案

的NoClassDefFoundError表示的 A不能在运行时找到℃。通常的原因是将c未能被部署到目标设备(模拟器或实际设备)。

A NoClassDefFoundError means that A cannot find C at runtime. The usual cause is that C failed to be deployed onto the target device (simulator or real device).

解决方案1:

有关在项目 - >属性 - > Java构建路径项目中确保C(库项目)是根据项目和相应的复选框上的订单和出口选项卡中选中上市。这将确保该库在构建和部署过程导出。

For project A under Project->Properties->Java Build Path ensure C (your library project) is listed under 'Projects' and the corresponding checkbox checked on the 'Order and export' tab. This should ensure that the library is exported during the build and deployment process.

解决方案2:

在项目中增加一个符号链接(右键单击项目 - >构建Path->链接源)到库中的C源程序。这将迫使当一个项目是建立在被列入该库的源$ C ​​$ C。

In project A add a symbolic link (right click project->Build Path->Link Source) to the library C source. This will force the library's source code to be included when project A is built.

这篇关于NoClassDefFoundError的导入库项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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