Jump to content
  • Advertisement
Sign in to follow this  
Multiverse

"Package System does not exist" error [SOLVED]

This topic is 4392 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I know what your all thinking, but i *have* spelt System correctly in my code! The background is that I've always relied on Eclipse, Eclipse ME and J2ME-Polish, but we have recently had to dump J2ME Polish and switch to using Antenna. Since the switch i've been plagued with problems, which i have managed to overcome, but this one has me stumped. Basically I get an error whenever I use the "System" object.('System.out.println' or 'System.currentTimeMillis' for example) It always worked before when but now it is not, and I cannot find any info about it on the net. When trying to compile my code for a different device, I get the following Error: "Unable to locate package java.lang in classpath or bootclasspath" and I think it is this which is why it cannot find the System package. As I said before I've relied on things to do all the setting up for me before, so now I don't know the basics!! Could somebody tell me how to set this up to use Ant and Antenna or at least give me some hints? Any help at all would be greatly appreciated! EDIT: I've also just noticed that I get another error: "cannot resolve symbol IOException" I assume there is something fundamentaly wrong with the way I've set things up (env variables or whatever), any ideas? [Edited by - Multiverse on July 7, 2006 11:29:51 AM]

Share this post


Link to post
Share on other sites
Advertisement
Looks like the bootclasspath property in Antenna's WtkBuild task is not pointing to the MIDP library. Which usually means you either have set the wtk.midpapi property incorrectly, or you haven't set it and wtk.home either points to a wrong directory or a non-UEI compliant SDK. Your best bet is pointing wtk.midpapi directly to the MIDP library (usually classes.zip or midpapi.zip).

Some links you might find useful:
A working Antenna build file, and the related thread.

If you still have problems you might want to post the build file you're using.

shmoove

Share this post


Link to post
Share on other sites
Hi Shmoove,

Thanks for the hints, but my buildfile is already based on that example and I have already read that thread! :P

I've echo'd my path for the ${wtk.midpapi} in the build.xml and it points to the correct place:

c:\WTK22\lib\midpapi10.jar

it is definitely pointing to midpapi.jar, but is that the right thing to point at?

I've also echo'd my ${wtk.home} and got this output:

c:\WTK22
which is exactly where the WTK is on my drive.

My device.properties file (nokia7210.properties) looks like this:


<!-- Nokia 7210 Phone -->

deploy.directory=/builds/nokia7210/dist

device.name=nokia7210
device.midp=midp1

mmapi.sound=noSound
mmapi.music=noMusic

wtk.cldc.version=1.0
wtk.midp.version=1.0
wtk.midpapi=${wtk.home}/lib/midpapi10.jar
wtk.mmapi.enabled=false
wtk.bluetooth.enabled=false
wtk.java3d.enabled=false
wtk.device=Nokia_S40_DP20_SDK_1_1
wtk.heapsize=1m

resources.path=res/nokia7210




and my local.properties:

<!-- local properties -->

wtk_home =C:/WTK22
wtk_proguard_home=C:/proguard3.6/lib
ant_home=C:/ant_1_6_5/bin
nokia_home=C:/nokia
antenna_lib=tools/bin/antenna-bin-0.9.13.jar
basedir=c:/mobile/midp
java_home=c:/j2sdk1.4.2_09



[Edited by - Multiverse on July 6, 2006 4:42:10 AM]

Share this post


Link to post
Share on other sites
The properties look OK.

I think I know what your problem is.

The old WTK only had one file that contained all the VM classes (it was called midpapi.zip). In the newer version (post 2.1 I think), they separated the bootstrap classes into separate files: cldcapi10.jar, cldcapi11.jar, midpapi10.jar, midpapi20.jar, mmapi.jar, etc.
So now you have to include more than one file in the bootclasspath property, including all the libraries you're building for (ie, cldcapi10.jar, midpapi20.jar, and mmapi.jar if you're targatting a CLDC 1.0/MIDP 2.0 phone). So the wtk.midpapi file should reflect that.

shmoove

Share this post


Link to post
Share on other sites
Brilliant!!

Thanks Shmoove, that worked like a charm! But I'd like to check a couple of things just to make what I've done won't cause me problems in the future. It works now, but maybe I havn't done it *quite* right.

Basically what I did was extract the midpapi10.jar, and the cldcapi10.jar, and then zipped the extracted folders into a single .zip file.

I named the zip file "midp1_cldc1.zip" and I was planning on creating similar ones for different configurations. For example "midp1_cldc1_1.zip" (containing midpapi10.jar and cldcapi20.jar)

would i be better off just creating 'one zip file to rule them all' containing all the api's I'm ever going to need? (and if i need a new one, i'll just add it to the zip) Which is similar to what was done in WTK < 2.1 from what i can gather.

Thanks again, your a lifesaver!

Share this post


Link to post
Share on other sites
What you did should be alright. I don't expect any more problems.

A MIDP 2.0/CLDC 1.0 with all the extras (MMAPI, M3G, WMA, etc.) would be the the package to rule them all. Since there's backward compatibility you can compile any profile/configuration with that. The down side is that any MIDP version errors won't be caught during compilation.

You could also just use a colon separated list of the original libraries in wtk.midpapi:

wtk.midpapi=${wtk.home}/lib/midpapi10.jar:${wtk.home}/lib/cldcapi10.jar


shmoove

Share this post


Link to post
Share on other sites
well in that case I think i'm going to use a colon seperated list for the wtk.midpapi property. I had read somewhere on the net ( here )that antenna wouldn't be able to interpret it and their advice was to put the api's you needed in a custom zip file. which is what i did, but shmoove to the rescue once again.

Lots of thanks once again.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!