Unknown unhandled exception in JVM (234)
After downloading a program I got this error:
Compiling works, so can it still be my program?
Kind regards,
Robot Freak
Post Edited (Robot Freak) : 12/17/2007 6:44:44 PM GMT
I tried again, same error.Javelin IDE said...
Unknown unhandled exception in JVM (234).
This is an internal error.
Report the error to technical support.
Compiling works, so can it still be my program?
Kind regards,
Robot Freak
Post Edited (Robot Freak) : 12/17/2007 6:44:44 PM GMT
Comments
there must be something not quite right in your program.
Probably an initialization issue, but can't tell until you post your code.
regards peter
The "firmware" folder is located in the default "lib" folder.
Kind regards,
Robot Freak
Post Edited (Robot Freak) : 12/12/2007 8:05:09 PM GMT
· static PWM motor1 = new PWM(CPU.pin13,169,2304);
· static PWM motor2 = new PWM(CPU.pin14,174,2304);
· static PWM motor3 = new PWM(CPU.pin15,173,2304);
and the error disappears.
Using
calc.motor_center[noparse][[/noparse]0] etc. generated·a null pointer exception (after I made motor a non-static class),
so apparently calc.motor_center is not initialized, possibly because motor.java gets initialized
before calc.java.
regards peter
Post Edited (Robot Freak) : 12/13/2007 1:15:03 PM GMT
Do you know how I can avoid this kind of errors?
I think this has to do something with my programming sturcure.
Thanks a lot,
Robot Freak
Edit:
I placed the void main into the motor.java file.
Now the errors are gone.
I still don't know why the previous program was wrong...
Post Edited (Robot Freak) : 12/13/2007 1:22:58 PM GMT
and no initialization prior to main().
The best way to tackle this is to make your classes non-static.
For example, you can rewrite your motor class as non-static for a single motor.
You then need a constructor that accepts PWM parameters.
In your application program (where main() is located)
static motor motor1 = new motor(pwmpin1,low,high);
static motor motor2 = new motor(pwmpin2,low,high);
static motor motor3 = new motor(pwmpin3,low,high);
static void main(){
...
}
All initialization that a motor requires can be done in the motor constructor.
This way you know initialization is done prior to running main().
regards peter
Kinds regards,
Robot Freak