3

I made the program Test.jar which there is a menu to run another program (Hello.jar). I've been looking for and get the following code

callLauncher("javaapp:midlet-name=Hello;midlet-vendor=Vendor");

and

PushRegistry.registerAlarm("Hello",now.getTime()+100);

but not successful - throws ClassNotFoundException. Is there another way?

gnat
  • 6,213
  • 108
  • 53
  • 73
  • 1
    does [registerAlarm](http://docs.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/javax/microedition/io/PushRegistry.html#registerAlarm(java.lang.String,%20long)) return any value or throw an exception? – gnat Feb 21 '12 at 11:04
  • throw an ClassNotFoundException.. :( it should be in a Midlet suite? Test application and Hello application is a different project – andysiahaan Feb 21 '12 at 13:33

1 Answers1

2

API documentation for the method you use (registerAlarm) explains pretty clearly what you did wrong:

Throws:
...ClassNotFoundException - if the MIDlet class name can not be found in the current MIDlet suite or if this class is not included in any of the MIDlet-<n> records in the descriptor file or the jar file manifest or if the midlet argument is null

gnat
  • 6,213
  • 108
  • 53
  • 73
  • so Test application and Hello application must be in a MIDlet suite? can not be in a different midlet? – andysiahaan Feb 21 '12 at 14:13
  • @And1Siahaan per my reading of API docs, MIDlet can be different but it has to be in same suite – gnat Feb 21 '12 at 14:27
  • so can not be in different suite? – andysiahaan Feb 21 '12 at 15:00
  • @And1Siahaan as far as I can tell it can not be in different suite. Though you'd better study API docs yourself if you want to be 100% sure about that – gnat Feb 21 '12 at 15:02
  • @And1Siahaan you're welcome. By the way you can also take a look at an "instruction" explaining how we at Stack Overflow deal with _helpful_ answers: http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work/5235#5235 – gnat Feb 22 '12 at 04:02