Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » DSDP - Mobile Tools for Java (MTJ) » cannot load files from res folder
cannot load files from res folder [message #565928] Sun, 25 February 2007 20:50
Eclipse UserFriend
Originally posted by: zhihui_yang73.yahoo.com

I just installed MTJ and have no problem to run some simple Java games as
long as no external images or sounds are needed. However, I always got
java.io.IOException and java.lang.NullPointerException when I try to load
images from the res folder. But I have no problem to run the java games
from the standalone SUN JWT emulator, or the emulator from Nokia. Is there
anything wrong with my MTJ setup?

Here is my setup:
Windows XP
Eclipse 3.2
MTJ 0.7
emf-sdo-xsd-SDK-2.2.0
Sun Java(TM) Wireless Toolkit 2.5 for CLDC

Below is the snipet of loading images located in folder "res"
...
Image img = null;
try {
img = Image.createImage("/img1.png");
} catch (IOException ex) {
System.out.println("Error: Image files could not be loaded " +
e.getMessage());
ex.printStackTrace();
}
...

When I tried to run the sample on SUN JWT emulator through MTJ, I got the
following error message (I had no problem to run the above code on the
standalone JWT emulator):

Error: Image files could not be loaded null
java.io.IOException
- javax.microedition.lcdui.Image.createImage(), bci=30
- Arena.<init>(), bci=72
- MEInvaders.startApp(), bci=17
- javax.microedition.midlet.MIDletInvoker.invokeStartApp(), bci=1
- com.symbian.midp.runtime.MIDletScheduler.startMIDlet(), bci=26
- com.symbian.midp.runtime.MIDletScheduler.run(), bci=14
Uncaught exception: java.lang.NullPointerException
- Arena.tick(), bci=4
- Arena.run(), bci=13
- java.lang.Thread.run(), bci=11

Any help or suggestion would be greatly appreciated.

Thanks a lot,
Yang
Previous Topic:Bad Stack Map error
Next Topic:Bad Stack Map error
Goto Forum:
  


Current Time: Tue Apr 16 20:14:30 GMT 2024

Powered by FUDForum. Page generated in 1.97919 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top