views:

1782

answers:

1

I have two projects in the same workspace using a single workspace with Eclipse.

Project1 - References Project #2 and also contains the "Java Build Path" for Project 2
Project2 - doesn't reference anything

Project1 package is called Project1
Project2 pacakge is called Proejct2

I import Projec2 into Project1 using:

import Project2.ClassName

When compiling I receive the error:

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

Any suggestions would be awesome

A: 

It may be because the preverification step were not done properly in the net.rim.eide library you are using.
This thread suggests actually to preverify the library independently, even to do the preverifying process for each class (as done here)!


Note: the preverification is:

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

VonC
I can compile no problem if there is only one project tho, this only happens if I have two.
footose
so... may be some issue with libraries used by Project2 may be? Or some side-effect of depending one project from the other in term of preverification steps... May be you could try making the dependencies less direct (i.e. not trough the "project" tab) and more through paths, to check if that still triggers the error.
VonC
ok..i removed the instantiation of the Project2, and left the import of the package and the error went away. then i added the instantitation again and the error came back. Then I removed the import, and directly instantiated the object like so: bbFindGUI.bbFindScreen bbf = new bbFindGUI.bbFindScreen();Error comes back again..
footose
Right, so it is linked to the use of a Project2 class, which trigger the preverification check and the error message. Could it be possible to make a manual preverification for Project2 classes before trying to use them in Project1?
VonC
I'm not sure how the manual preverification works, but I will check it out today and get back to you.
footose