문제

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

도움이 되었습니까?

해결책

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());
    }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top