Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 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:

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 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
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 " +

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
- 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
-, bci=14
Uncaught exception: java.lang.NullPointerException
- Arena.tick(), bci=4
-, bci=13
-, bci=11

Any help or suggestion would be greatly appreciated.

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

Current Time: Thu May 24 08:10:18 GMT 2018

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

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

Back to the top