cannot load files from res folder [message #18875] |
Sun, 25 February 2007 20:50 |
Eclipse User |
|
|
|
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
|
|
|
Re: cannot load files from res folder [message #18919 is a reply to message #18875] |
Wed, 28 February 2007 20:44 |
Kevin Horowitz Messages: 36 Registered: July 2009 |
Member |
|
|
The contents of the 'res' folder are added the the deployed jar and
available for use when testing the Java ME app. You need to use the MTJ
run in order to set the paths correctly and use the Deployed jar. If
you have not done this, the images will not be seen.
Z Yang wrote:
> 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
>
>
>
|
|
|
Re: cannot load files from res folder [message #18941 is a reply to message #18919] |
Mon, 05 March 2007 22:10 |
Eclipse User |
|
|
|
Originally posted by: zhihui_yang73.yahoo.com
Hello Kevin,
It did create jar file and the JAD file in the "deployed" folder. I
checked the jar file and all the content in "res" are there. I used run ->
"MTJ Application" to run the application as suggested in the MTJ help.
Whatelse do you think I might miss?
Thanks a lot!
Yang
|
|
|
Re: cannot load files from res folder [message #565997 is a reply to message #18875] |
Wed, 28 February 2007 20:44 |
Kevin Horowitz Messages: 36 Registered: July 2009 |
Member |
|
|
The contents of the 'res' folder are added the the deployed jar and
available for use when testing the Java ME app. You need to use the MTJ
run in order to set the paths correctly and use the Deployed jar. If
you have not done this, the images will not be seen.
Z Yang wrote:
> 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
>
>
>
|
|
|
Re: cannot load files from res folder [message #566025 is a reply to message #18919] |
Mon, 05 March 2007 22:10 |
Eclipse User |
|
|
|
Originally posted by: zhihui_yang73.yahoo.com
Hello Kevin,
It did create jar file and the JAD file in the "deployed" folder. I
checked the jar file and all the content in "res" are there. I used run ->
"MTJ Application" to run the application as suggested in the MTJ help.
Whatelse do you think I might miss?
Thanks a lot!
Yang
|
|
|
Powered by
FUDForum. Page generated in 0.02950 seconds