0

I wrote some code to load textures from files. It works nicely on windows machines, but once I sent it home to work on OSX, it keeps crashing. This is a simple bit of code:

String path = System.getProperty("user.dir") + File.separator + "textures"
            + File.separator;
File file = new File(path + "steel.jpg");

try {
    shipTexture = TextureIO.newTexture(file , true);
} catch {GLException e) {
} catch {IOException e) {
}

I get the following exception: Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/gluegen/runtime/DynamicLookupHelper

at the texture init stage,

Caused by: java.lang.ClassNotFoundException: com.sun.gluegen.runtime.DynamicLookupHelper at at java.net.URLClassLoader$1.run

Why is this not working?

1
  • Have a look at guyford.co.uk/… it describes how to load a texture and set it up. Commented Jul 19, 2012 at 11:22

1 Answer 1

1

A classNotFoundException usually doesn't have much to do with your code, it means your class isn't in the classpath this can be because your editor doesn't find it -

http://www.wikihow.com/Add-JARs-to-Project-Build-Paths-in-Eclipse-%28Java%29

Or because you directory structure is different in windows and mac -

http://www.ibm.com/developerworks/library/j-classpath-unix/

try removing the package and adding it again to you classpath

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.