Trying to use OpenGL in Java on Netbeans but getting an error. Please help [migrated]
- by Steven Rogers
I am on a Mac running Netbeans 6.9.
I downloaded and installed LWJGL using this tutorial down to the letter:
http://lwjgl.org/wiki/index.php?title=Setting_Up_LWJGL_with_NetBeans
I finished the installation and copied sample code to see if my system is working. I got a bug, and was not sure if it was because of faulty code or i was doing something wrong. So i shortened down the code to this little simple bit:
package javaopengl;
import org.lwjgl.Sys;
import org.lwjgl.opengl.Display;
//Testing
public class Main {
public static void main(String[] args) {
boolean fullscreen = (args.length == 1 && args[0].equals("-fullscreen"));
try {
Display.create();
Display.destroy();
} catch (Exception e) {
e.printStackTrace(System.err);
}
System.exit(0);
}
}
But i still get the same error, this is the error that i get:
run:
Exception in thread "main" java.lang.NoClassDefFoundError: =
Caused by: java.lang.ClassNotFoundException: =
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
I am not sure what exactly is going on, Would you please tell me what is going on and how to fix it?
It would be greatly appreciated, and thank you.
Note: When i am looking at the text in the development environment, it does not show those red lines indicating there are any errors.