localy my game works fine, but when i try to launch it over webstart, ResourceLocator can't seem to find the resources anymore.
java.lang.NullPointerException: baseDir can not be null.
at com.jme.util.resource.SimpleResourceLocator.<init>(Unknown Source)
at stardust.core.Start.main(Start.java:53)
Inside the main package stardust, i have all other packages and also the data folder.
stardust.data.textures
stardust.data.sounds
stardust.scene
ect.
is that the correct way to setup packages?
ResourceLocatorTool.addResourceLocator(ResourceLocatorTool.TYPE_TEXTURE,
new SimpleResourceLocator(Start.class.getClassLoader().getResource( "stardust/data/textures/")))
;
if someone wants to try:
http://www.stardust.ch/webstart/stardust.jnlp
In the meantime is there a way to "emulate" these errors when I run the project in eclipse. It is very frustrating to have the project all working off the "play" button in eclipse and then eating s**t when I make a jnlp
How do I add the models and textures folders to the classpath in eclipse? There are 2 buttons 1 is marked Add Folder, the other is marked link source, whats the difference?
How do I mark them as source in eclipse project properties? The dirs are under the src (src/data/models)
The src dir is set in the "source" properties and it says Included (all). shouldn't that take care of it? If I try and add the models and textures dirs seperately it gives me a nesting error and I can't continue.
src/data/models should be fine then, as 'src' is already a source folder.
That should work:
ResourceLocatorTool.addResourceLocator(
ResourceLocatorTool.TYPE_MODEL,
new SimpleResourceLocator(YourClass.class.getClassLoader().getResource("data/models/")));