Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

i am new in j2me (compilaton problem on command prompt)

 
SHAHID SALEEM
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am new to j2me tech.
i have installed sun j2me kit
i have installed sun jdk1.3
j2me kit is installed at c:\j2mewtk
jdk1.3 kit is installed at c:\jd1.3
i have no ide for writting code except notepad so i wrote an example for running "HelloWorld.java" in notepad
then i set %sunj2mehome% variabel a
c:\set sunj2mehome=c:\j2mewtk
then i complied source code as
c:\jdk1.3\bin\javac -bootclasspath %sunj2mehome%\lib\midpapi.zip
-classpath %sunj2mehome%\wtklib\kvem.jar HelloWorld.java
this process gave a file HelloWorld.class
- now by what means i have to preverify , give me answer as per my setted env.
creating a jar file
--------------------
i use followin command for creating jar file
c:\jdk1.3\bib\jar cmf manifest HelloWorld.jar HelloWorld.class
this gave a jar file

excetion midlet from applicaton descriptor
-------------------------------------------
i used following command for running

set codepath=c:\jdk1.3\bin
set classpath=%sunj2mehome%\lib\kvem.jar;%sunj2mehome%\wtklib\kenv.zip;%sunj2mehome%\wtklib\lime.jar;%codepath%;

c:\jdk1.3\bin\java -Dkvem.home=%sunj2mehome% - classpath %classpath% com.sun.kvem.midp.Main DefaultGrayPhone - descriptor HelloWorld.jad

but above command gave me error DefaultGrayPhone ClassNotFoundException
** i followed above instruction from a book "Wirless java Programming with j2me by feng and dr. jun zhu"
please help me


[This message has been edited by SHAHID SALEEM (edited December 15, 2001).]
 
Raghav Mathur
Ranch Hand
Posts: 641
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why don't you use the toolkit for this purpose !
Originally posted by SHAHID SALEEM:
i am new to j2me tech.
i have installed sun j2me kit
i have installed sun jdk1.3
j2me kit is installed at c:\j2mewtk
jdk1.3 kit is installed at c:\jd1.3
i have no ide for writting code except notepad so i wrote an example for running "HelloWorld.java" in notepad
then i set %sunj2mehome% variabel a
c:\set sunj2mehome=c:\j2mewtk
then i complied source code as
c:\jdk1.3\bin\javac -bootclasspath %sunj2mehome%\lib\midpapi.zip
-classpath %sunj2mehome%\wtklib\kvem.jar HelloWorld.java
this process gave a file HelloWorld.class
- now by what means i have to preverify , give me answer as per my setted env.
creating a jar file

 
Eric Giguere
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Indeed, I would just use the toolkit itself. But if you want to do it by hand, you need to run preverify.exe on the .class files you want to use. You'll need two directories -- one directoy to hold the original .class files and one to hold the verified .class files. You then create your jar from the .class files in the latter. I'm surprised the book you're using doesn't show you how. Maybe the problem is you're using the toolkit -- it's not really meant for standalone/batch mode operation. You can download a MIDP reference implementation from the Sun site that is better suited for that. Complete instructions on this kind of stuff are given in my latest book, by the way.

------------------
Eric Giguere
author/co-author of:
Mobile Information Device Profile for Java 2 Micro Edition: Professional Developer's Guide
Java 2 Micro Edition: Professional Developer's Guide
PalmTM Database Programming: The Complete Developer's Guide
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic