Question

Can you help me resolve this?

Exception in thread "main" com.jme3.asset.AssetNotFoundException: Interface/splash.png
    at com.jme3.system.JmeDesktopSystem.showSettingsDialog(JmeDesktopSystem.java:112)
    at com.jme3.system.JmeSystem.showSettingsDialog(JmeSystem.java:128)
    at com.jme3.app.SimpleApplication.start(SimpleApplication.java:125)
    at adventure.Q3World.main(Q3World.java:85)

It used to work, then I had to repackage everything and now I might've forgotten a setting or likewise in Eclipse. The splash file is there but it is not on some path.

What I'm trying to to is this, which works in my previous build:

settings.setSettingsDialogImage("Interface/splash.png");

I've also tried adding the path to the resource panel but to no other effect:

enter image description here

And in Java build path, the resource is listed but it's still not working:

enter image description here

The larger code block that I want to work and that which is working in the built jar but not from within eclipse juno is:

public static void main(String[] args) {

        File file = new File("quake3level.zip");
        if (!file.exists()) {
            useHttp = true;
        }
        Q3World app = new Q3World();
        AppSettings settings = new AppSettings(true);
        settings.setTitle("Dungeon World");
        settings.setSettingsDialogImage("Interface/splash.png");
        app.setSettings(settings);

        app.start();
    }

Success

enter image description here

Was it helpful?

Solution

Can you tell us how you run your code (e.g. command line, if so, what is the classpath), and where all the locations of splash.png are in your folder structure?

The file needs to be on the classpath, as that appears to be from where this code loads the image.

http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/desktop/com/jme3/system/JmeDesktopSystem.java?spec=svn10038&r=10038#112

    String iconPath = sourceSettings.getSettingsDialogImage();        
    if(iconPath == null){
        iconPath = "";
    }
    final URL iconUrl = JmeSystem.class.getResource(iconPath.startsWith("/") ? iconPath : "/" + iconPath);
    if (iconUrl == null) {
        // *****LINE 112 below*****
        throw new AssetNotFoundException(sourceSettings.getSettingsDialogImage());
    }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top