Reputation: 11
I am running a midlet application already deployed & run on Nokia S60 sdk. I want to make my app run on every java & symbian device. I tried to run the application on Java_ME_platform_SDK_3.4 but getting an error in the code when i am trying to switch the screen from Login to Home
HomeForm homeForm=new HomeForm(objLoginMidlet, objCommonBean);
Display.getDisplay(objLoginMidlet).setCurrent(homeForm);
Code in Home Form is as follows-
class HomeForm extends Form
{
public HomeForm(LoginMidlet objLoginMidlet,CommonBean objCommonBean)
{
this.objLoginMidlet=objLoginMidlet;
this.objCommonBean=objCommonBean;
setTimer();
initHomeForm();
}
}
My MIDP is set to 2.1. Even I changed it to 2.0 but still getting exception as follows
warning** *Untrusted user classes must never be put ***on the system class path
TRACE: <at java.lang.Error: ClassFormatError: 154>, Exception caught in Display class
java.lang.Error: ClassFormatError: 154
- java.lang.Class.invoke_verify(), bci=0
- java.lang.Class.initialize(), bci=100
- ezypoint.forms.LoginForm.register(LoginForm.java:202)
- ezypoint.forms.LoginForm.commandAction(LoginForm.java:91)
Even I tried to change compilance level but still exception appears.
Upvotes: 1
Views: 632
Reputation: 1032
I don't know the Nokia S60, but this usually happens on CLDC devices when compiled Java class files are being deployed without having them "preverified". This is an additional build step that is required to run them on embedded JavaME devices. See this StackOverflow question.
If you hava a full-blown development environment, this is usually set up automatically (maybe you need to choos the correect target device). However, if you try to compile the Java files by yourself and then run them on your device, it will crash. In this case, you need to call %YOUR_WTK_HOME%\bin\preverify.exe with your class files (and probably add to your ANT script or similar):
%YOUR_WTK_HOME%\bin\preverify.exe -classpath <your-classpath> -d <your-destination-dir> <your-source-directory>
Upvotes: 0