Shop OBEX P1 Docs P2 Docs Learn Events
Unknown unhandled exception in JVM (234) — Parallax Forums

Unknown unhandled exception in JVM (234)

Robot FreakRobot Freak Posts: 168
edited 2007-12-14 15:50 in General Discussion
After downloading a program I got this error:
Javelin IDE said...
Unknown unhandled exception in JVM (234).
This is an internal error.
Report the error to technical support.
I tried again, same 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

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-12-12 16:25
    It is a runtime error (not a compile time error) so
    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
  • Robot FreakRobot Freak Posts: 168
    edited 2007-12-12 17:47
    There you go.
    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
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-12-12 18:48
    In motor.java define
    · 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
  • Robot FreakRobot Freak Posts: 168
    edited 2007-12-12 20:08
    Thanks a lot Peter!

    Post Edited (Robot Freak) : 12/13/2007 1:15:03 PM GMT
  • Robot FreakRobot Freak Posts: 168
    edited 2007-12-13 13:16
    Now I get the same error, but a different number: "Unknown unhandled exception in JVM (311)."
    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
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-12-13 18:15
    I would say these kind of errors occur because you use all static classes
    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
  • Robot FreakRobot Freak Posts: 168
    edited 2007-12-14 15:50
    Okay, I will try.

    Kinds regards,
    Robot Freak
Sign In or Register to comment.