footose
footose

Reputation: 185

Error Preverifying Class - Java / Eclipse / Blackberry

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

Upvotes: 4

Views: 6175

Answers (4)

S-K'
S-K'

Reputation: 3209

Before trying anything delete the bin folder and re-compile. The error can occur when you build the project with one JRE system library and then later change to another.

Upvotes: 1

T Martin
T Martin

Reputation: 31

I received this error when I was using default Java 6 compiler settings. Try setting them down to 1.3 by going to "Properties > Java Compiler" and messing with those settings.

Upvotes: 3

gburgoon
gburgoon

Reputation: 601

To compile properly, right click on Project1 and go to "Properties > Java Build Path> Projects". Add Project2 as a dependancy, and you will be able to compile properly.

Upvotes: 0

VonC
VonC

Reputation: 1323953

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

Upvotes: 3

Related Questions