错误预验证类--Java/Eclipse/Blackberry

问题描述:

我在同一个工作区中使用单个工作区和Eclipse的两个项目。错误预验证类--Java/Eclipse/Blackberry

PROJECT1 - 参考项目#2和还包含项目2
的 “Java构建路径” Project2的 - 不引用任何

PROJECT1包被称为PROJECT1
Project2的pacakge被称为Proejct2

我导入Projec2到PROJECT1使用:

import Project2.ClassName 

编译时我收到错误:

Error preverifying class Project1.Launcher Project1 line 0 BlackBerry Java Problem 
Error!: Error: preverifier failed: C:\Users\footose\Desktop\eclipse\plugins\net.rim.eide.componentpack4.5.0_4.5.0.16\components\bin\prev ... Project1  line 0 BlackBerry Java Problem 

任何建议将是真棒

这可能是因为预验证步骤中没有您所使用的net.rim.eide库得当。
此线程建议实际到preverify the library independently,甚至为每个班级做预验证过程(如完成here)!


注:preverification是:

a phase in the development and deployment cycle for Java applications designed to run on the J2ME CLDC (Connected Limited Device Configuration).

Preverification performs certain checks on the Java bytecodes ahead of runtime.
If this first verification pass is ok, the preverifier annotates the classfiles (using standard Java bytecode "attributes", so that these are still plain old Java bytecodes and will be executable in VMs not aware of the benefits of preverification), and then saves the annotated class files or passes them along to the next tool in the compile chain.

When the KVM attempts to run execute a J2ME CLDC-based application, it checks the Java class files for these preverification annotations. Proper annotations in the class files guarantee that certain compile-time checks were made, and so the KVM can pass through its own verfication and security checks much faster and start executing the application more quickly.

Sun's CLDC reference implementation SDK includes the 'preverify' tool. You use the tool after compiling your code via javac (or your favorite Java compiler).

+0

如果只有一个项目,我可以编译没有问题,只有当我有两个时才会发生。 – footose 2009-07-21 20:05:48

要正确编译,用鼠标右键单击Project1,然后进入 “属性> Java构建路径>项目”。添加Project2作为依赖,并且您将能够正确编译。

我在使用默认Java 6编译器设置时收到此错误。尝试将它们设置为1.3,方法是转到“Properties> Java Compiler”并混淆这些设置。

尝试任何操作之前,请删除bin文件夹并重新编译。当您使用一个JRE系统库构建项目,然后更改为另一个时,可能会发生该错误。