File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Unable to locate package java.lang Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Unable to locate package java.lang" Watch "Unable to locate package java.lang" New topic
Author

Unable to locate package java.lang

Martin Felando
Greenhorn

Joined: Jun 10, 2004
Posts: 5
I can't seem to get past the setup phase. I downloaded J2sdk1.4.2 and midp 1.0 following instructions in a "J2ME Game Programming" book. I made path, midp_home, classpath changes and I think therein lies the problem - I just don't understand the fundamentals.

I preverified and the midp emulator is available, but when I compiled and ran the midlet the message "Hello, Micro World!" didn't show up. The emulator showed up but the screen had no message and the only command that worked was "quit".

I saved code and used "javac -target 1.1 -bootclasspath %MIDP_HOME%\classes Hello.java" and getting "unable to locate package java.lang" error messages. I reentered some classpath and path data and this got me to the empty emulator but this quick fix doesn't inspire self confidence.

Earlier, when I preverified the class file entering "preverify -cldc -classpath %MIDP_HOME%\classes;. -d . Hello" I was getting
"Error preverifying class Hello
java/lang/NoClassDef Found Error: javax/microedition/lcdui/CommandListener"

I'd like to know what those errors meant, why the Hello, Micro World message didn't show up on the emulator, and how to properly setup environment variables classpath, path, and midp.

with kind regards,
mf
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

I don't know MIDP, perhaps you find something in 'Other java APIs'.

Why do you use '-target 1.1'? Is this recommended for midp?
Is 'javax/microedition' part of 1.1?

On Windows:

paste the settings.txt here.


http://home.arcor.de/hirnstrom/bewerbung
Martin Felando
Greenhorn

Joined: Jun 10, 2004
Posts: 5
I'm quoting from the book: "The -target 1.1 is there due to a known issue when using JDK 1.4 and the MIDP preverifying tool. If you compile normally you see a Class loading error: Illegal constant pool index error when you attempt to preverify later. To avoid this, you force the Java compiler to output class files in the older 1.1 version format. If you're using a version of the MIDP later than 1.03, feel free to give things a go without this option."

I hope that helps. I don't know what to do with your instructions per "ECHO PATH..." etc. How do I begin to input the data? Where do I start?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to locate package java.lang