Hello Guest

[ERROR] Need Help Fixing This Error

  • 6 Replies
  • 3947 Views
[ERROR] Need Help Fixing This Error
« on: March 17, 2013, 05:31:06 »
Hey,

IDE: Eclipse 4.2.2
OS: Mac OSX Mountain Lion (10.8.3)
Java: 1.7
LWJGL: Latest?

I recently *just* got around to installing Eclipse and LWJGL. I have previous experience with Java via a college-level course (in high school) in computer science. I recently just got done "learning" (more like "toying") with Objective-C and OSX/iOS development. I've been wanting to do Java game development for quite some time now.

Anyhow,
I was completing the very first basic tutorial regarding displays. My code is basically exactly the same as provided in the example:

http://www.lwjgl.org/wiki/index.php?title=LWJGL_Basics_1_%28The_Display%29

Code: [Select]
import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;

public class MainTest
{

public void start()
{
try
{
Display.setDisplayMode(new DisplayMode(800, 600));
Display.create();
} catch (LWJGLException e)
{
e.printStackTrace();
System.exit(0);
}

//init OpenGL here

while (!Display.isCloseRequested() )
{
//render OpenGL here
Display.update();
}

Display.destroy();
}

public static void main(String[] args)
{
MainTest mainTest = new MainTest();
mainTest.start();
}
}

When running, the created window/display flashes for barely a fraction of a second and I get this error in the console:

Quote
JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM
org.lwjgl.LWJGLException: Could not get the JAWT interface
   at org.lwjgl.opengl.AWTSurfaceLock.lockAndInitHandle(Native Method)
   at org.lwjgl.opengl.AWTSurfaceLock.access$100(AWTSurfaceLock.java:51)
   at org.lwjgl.opengl.AWTSurfaceLock$1.run(AWTSurfaceLock.java:94)
   at org.lwjgl.opengl.AWTSurfaceLock$1.run(AWTSurfaceLock.java:92)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.lwjgl.opengl.AWTSurfaceLock.privilegedLockAndInitHandle(AWTSurfaceLock.java:92)
   at org.lwjgl.opengl.AWTSurfaceLock.lockAndGetHandle(AWTSurfaceLock.java:66)
   at org.lwjgl.opengl.MacOSXCanvasPeerInfo.initHandle(MacOSXCanvasPeerInfo.java:57)
   at org.lwjgl.opengl.MacOSXDisplayPeerInfo.doLockAndInitHandle(MacOSXDisplayPeerInfo.java:56)
   at org.lwjgl.opengl.PeerInfo.lockAndGetHandle(PeerInfo.java:85)
   at org.lwjgl.opengl.MacOSXContextImplementation.create(MacOSXContextImplementation.java:47)
   at org.lwjgl.opengl.ContextGL.<init>(ContextGL.java:132)
   at org.lwjgl.opengl.Display.create(Display.java:847)
   at org.lwjgl.opengl.Display.create(Display.java:754)
   at org.lwjgl.opengl.Display.create(Display.java:736)
   at MainTest.start(MainTest.java:15)
   at MainTest.main(MainTest.java:36)

I do believe I properly set up LWJGL to work with Eclipse (following the providing installation documentation).

Cheers,
Shane
« Last Edit: March 17, 2013, 05:57:19 by xShane »

*

Offline quew8

  • *****
  • 569
  • Because Square Eyes Look More Real
Re: [ERROR] Need Help Fixing This Error
« Reply #1 on: March 17, 2013, 08:48:24 »

Re: [ERROR] Need Help Fixing This Error
« Reply #2 on: March 17, 2013, 18:06:07 »
http://lwjgl.org/forum/index.php/topic,4711.0.html I believe this is you problem.

Yupp, unfortunately it appears so.

I guess my only option is to downgrade to a different version of Java? Or maybe switch to Ubuntu/Linux for developing until it gets fixed?
« Last Edit: March 17, 2013, 18:08:03 by xShane »

*

Offline kappa

  • *****
  • 1314
Re: [ERROR] Need Help Fixing This Error
« Reply #3 on: March 17, 2013, 18:51:14 »
Yupp, unfortunately it appears so.

I guess my only option is to downgrade to a different version of Java? Or maybe switch to Ubuntu/Linux for developing until it gets fixed?
Or use the nightly builds for LWJGL 2.9 provided in that thread and carry on using OS X and Java 7.
« Last Edit: March 17, 2013, 18:54:35 by kappa »

Re: [ERROR] Need Help Fixing This Error
« Reply #4 on: March 17, 2013, 19:08:47 »
Yupp, unfortunately it appears so.

I guess my only option is to downgrade to a different version of Java? Or maybe switch to Ubuntu/Linux for developing until it gets fixed?
Or use the nightly builds for LWJGL 2.9 provided in that thread and carry on using OS X and Java 7.

Awesome. What are the current downsides to using a nightly build (I understand what it is)?

EDIT: Just tried 2.9. Still get the same error as before. I reverted back to 2.8.5 and also will use Java 6 instead of Java 7 until things get sorted out. Alternatively, should I use Linux/Ubuntu and then port back to Mac when things are fixed?
« Last Edit: March 17, 2013, 21:54:53 by xShane »

*

Offline kappa

  • *****
  • 1314
Re: [ERROR] Need Help Fixing This Error
« Reply #5 on: March 18, 2013, 14:53:17 »
You really shouldn't get that error with the lwjgl 2.9 builds when running your above test case, just make sure you replaced the jars/natives properly.

Try call

System.out.println("LWJGL VERSION: " + Sys.getVersion());

At the beginning of your application to double check that you've replaced the jars/natives properly to LWJGL 2.9.
« Last Edit: March 18, 2013, 15:04:57 by kappa »

Re: [ERROR] Need Help Fixing This Error
« Reply #6 on: March 18, 2013, 21:07:44 »
You really shouldn't get that error with the lwjgl 2.9 builds when running your above test case, just make sure you replaced the jars/natives properly.

Try call

System.out.println("LWJGL VERSION: " + Sys.getVersion());

At the beginning of your application to double check that you've replaced the jars/natives properly to LWJGL 2.9.

Just double checked, it printed 2.9.0, but still get the error (while on Java 7 w/ lwjgl 2.9.0).