This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Hi there, I've just started to program using J2ME and I'm already stuck I've been using the book J2ME game programming and so its been looking pretty useful, but I've already run into a problem I can't seem to work out. I've downloaded all the bits and bobs from the sun website and everything seems to be set up ok, but when I try to compile my first program using the command line javac command I get a message telling me javac isn't a recognised internal or external command. I'm using windows xp, and have the WTK2.1, Midp 1.0 and CLDC 1.0. Can somebody please help, I'm new at this but eager to get started and I seem to fallen at the the first hurdle.
If you are new to Java (pardon me if you're not) then you may not have downloaded a Java Development Kit (JDK). You can get this from Sun's website too. I'd go for one of the 1.4.x versions, I think there's some difficulties with J2ME on 1.5/5.0.
If you have a JDK installed already then you may want to add the bin directory to your PATH. Alternatively you can call 'javac' directly by specifying the full pathname. E.g. instead of
1. setup your path environment variable in Window to include your sdk bin directory.
2. The Wireless Toolkit can also compile your code. wtkdir\apps\YourAppDirectory\YourJavaFiles. Then start the Toolkit, select your App and choose compile. That's how I compile my J2ME stuff, rather than using the command line.
Joined: Jan 24, 2005
Thanks for the advice all. Sry about the name, my bad . I'll try the suggestions and let you know.
Joined: Jan 24, 2005
Ok adding the bin file to the path sorted that one out, thanks !
The next step was to preverify the class file, but when I entered the command it just kept telling me the usages of preverify, like I hadn't even entered any of the rest of it.
Here's the command line I'm using: preverify -cldc -classpath %MIDP_HOME%\classes;. -d .hello
I'm in the right directory and I'm sure that should work. It's so frustrating to be having so many problems early on