NoClassDefFoundError importing a library project

后端 未结 1 1470
生来不讨喜
生来不讨喜 2021-01-26 19:41

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

  • A. Unit test application (type:CLDC
相关标签:
1条回答
  • 2021-01-26 20:16

    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).

    Solution 1:

    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.

    Solution 2:

    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.

    0 讨论(0)
提交回复
热议问题