i am new in j2me (compilaton problem on command prompt)
SHAHID SALEEM
Greenhorn
Joined: Oct 04, 2000
Posts: 8
posted
0
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%;
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
Joined: Jan 12, 2001
Posts: 639
posted
0
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
Raghav.
Eric Giguere
Ranch Hand
Joined: Oct 25, 2000
Posts: 170
posted
0
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.