• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

file .jar and .jad

 
Mickael Terrien
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How generate the file.jar under forte for java.
I've got this error when i execute my emulator :
Unable to create MIDlet HelloMIDlet
java.lang.ClassNotFoundException: HelloMIDlet
at com.sun.midp.midlet.Selector.commandAction(+47)
at javax.microedition.lcdui.Display$DisplayAccessor.commandAction(+152)
at com.sun.kvem.midp.lcdui.EmulEventHandler$EventLoop.run(+427)
Thanks
 
Mickael Terrien
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use Forte For Java and J2ME (midp,cldc).
I have those files in my package c:/ProjetJ2ME/src/HelloMIDlet :
HelloMIDlet.java
HelloMIDlet.class
HelloMIDlet.jar
HelloMIDlet.jad
// I declare the package in my java file : package HelloMIDlet
When I execute HelloMIDlet.jad (under Forte), the Gray phone appears and we can read the file name (HelloMIDlet) on the screen (Emulating).
But when I launch the program, a ClassNotFoundException appears :
Unable to create MIDlet HelloMIDlet.HelloMIDlet
java.lang.ClassNotFoundException: HelloMIDlet.HelloMIDlet
at com.sun.midp.midlet.Selector.commandAction(+47)
at javax.microedition.lcdui.Display$DisplayAccessor.commandAction(+152)
at com.sun.kvem.midp.lcdui.EmulEventHandler$EventLoop.run(+427)
I think it comes from my pathes :
//autoexec.bat
PATH=C:\jdk1.3.1_02\bin;C:\jdk1.3.1_02\lib;
PATH=%PATH%;c:\j2me\midp1.0.3fcs\bin;c:\j2me\j2me_cldc\bin;
SET CLASSPATH=.;C:\j2me\midp1.0.3fcs\classes;
I tried to precise my jar file in the classpath :
SET CLASSPATH=.;C:\j2me\midp1.0.3fcs\classes;
SET CLASSPATH=%CLASSPATH%;C:\ProjetJ2ME\src\HelloMIDlet\HelloMIDlet.jar
But I always have my error !
Can it be a package problem, a classpath problem ... ???
Thank you
(Excuse my english)
 
a sanjuan
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just a sidenote:
have you tried to use Sun's J2ME wireless toolkit, with the ktoolbar?
i find that it makes it easier to do preverication and compilation than doing the things manually. you just make sure you place the src and resources in the correct folder structure and it will handle the rest for you.
 
a sanjuan
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, i forgot to answer the question.
first, could you give more info?
how do you launch it? .bat file, and what does that say? what does your .jad file say? what steps did you take to compile,preverify, the classes?
if you list HelloMidlet in the jad file, but it can't find it, or there is no such thing, it will give the same exception you just mentioned, a class not found exception when you try to run it on an emulator m(i.e., it will be named in the emulator, but when you click on it, the exception will be thrown).
 
Mickael Terrien
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes i have exactly the problem you have mentioned in your "if...".
Have you ever encountered that problem ?
Have you a solution ?
thank you
 
a sanjuan
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi:
ok, since i see no more info forthcoming, i'll just note down what you can do.
if you have downloaded and installed the sun j2me toolkit:
(1) place your source file (HelloMidlet.java) in the src/example folder of the apps/example folder. place any resource images etc in the res folder.
(2) open ktoolbar, and open the example project.
(3) go to SETTINGS, and click on the MIDLets tab.
(4) add in the name of your Midlet to the list of midlets there. since your app will be part of the package example, the class name should be example.HelloMidlet.
(5) save it, then BUILD.
(6) RUN.
ONce you get this working, you can create your own projects.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic