Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Weird ClassNotFoundException in Java
#3
Code:
run:

     [java] libGL error: dlopen /usr/lib/fglrx/dri/i965_dri.so failed (/usr/lib/fglrx/dri/i965_dri.so: cannot open shared object file: No such file or directory) <- ignore that, opengl wants to use my discrete gfx card which is currently disabled
     [java] Exception in thread "main" java.lang.NoClassDefFoundError: org/newdawn/slick/util/ResourceLoader
     [java] at ImageAtlas.<init>(Unknown Source)
     [java] at MainJump.main(Unknown Source)
     [java] Caused by: java.lang.ClassNotFoundException: org.newdawn.slick.util.ResourceLoader
     [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
     [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
     [java] at java.security.AccessController.doPrivileged(Native Method)
     [java] at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
     [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
     [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
     [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
     [java] ... 2 more
     [java] Java Result: 1
I'm on Ubuntu 14.04 and latest java 1.7
The snippet of code which uses the class ResourceLoader:
Code:
import org.newdawn.slick.util.ResourceLoader;          //used here
import org.newdawn.slick.opengl.Texture;
import org.newdawn.slick.opengl.TextureLoader;

import java.io.IOException;

public class ImageAtlas{

    private Texture texture;

    ImageAtlas(String path){

        try{

            texture = TextureLoader.getTexture("PNG",
                ResourceLoader.getResourceAsStream(path)); //and here
        }
        catch(IOException e){

            System.out.println("Could not load texture");
            e.printStackTrace();
        }
    }
}
getResourceAsStream(String) is the only method I'm using from ResourceLoader
Let me know if you need any more info.


Messages In This Thread
Weird ClassNotFoundException in Java - by CHmSID - 01-11-2015, 07:18 PM
RE: Weird ClassNotFoundException in Java - by CHmSID - 01-12-2015, 07:43 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)