aspose file tools
The moose likes Java Micro Edition and the fly likes i am new in j2me (compilaton problem on command prompt) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Reply Bookmark "i am new in j2me (compilaton problem on command prompt)" Watch "i am new in j2me (compilaton problem on command prompt)" New topic
Author

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

SHAHID SALEEM
Greenhorn

Joined: Oct 04, 2000
Posts: 8
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

Joined: Jan 12, 2001
Posts: 639
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
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


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 and PalmTM Database Programming: The Complete Developer's Guide
 
IntelliJ Java IDE
 
subject: i am new in j2me (compilaton problem on command prompt)
 
Threads others viewed
How to run midlet?
cannot compile
Confusion of the installation
Testing my 1st MIDlet - Sams 21 days J2ME book
Help! does j2me wireless toolkit need other packages
IntelliJ Java IDE