7

I'm having trouble trying to figure out why my LWJGL3 application won't run outside NetBeans. I copied all the natives to the same dir. as the Jar and I get an error if I run directly from the Jar:

[LWJGL] GLFW_API_UNAVAILABLE error
    Description : WGL: The driver does not appear to support OpenGL
    Stacktrace  :
            org.lwjgl.glfw.GLFW.nglfwCreateWindow(GLFW.java:1146)
            org.lwjgl.glfw.GLFW.glfwCreateWindow(GLFW.java:1227)
            com.alpha.core.Window.Init(Window.java:101)
            com.alpha.core.Game.GameLoop(Game.java:33)
            com.alpha.core.Game.Start(Game.java:23)
            com.alpha.tests.Main.main(Main.java:11)
Exception in thread "main" java.lang.RuntimeException: Failed to create the GLFW window
    at com.alpha.core.Window.Init(Window.java:103)
    at com.alpha.core.Game.GameLoop(Game.java:33)
    at com.alpha.core.Game.Start(Game.java:23)
    at com.alpha.tests.Main.main(Main.java:11)

The graphics driver is updated, the application works if I run from the IDE, all the DLLs are there, I don't know what can be causing this.

Any help will be appreciated, thanks in advance!

5
  • 1
    Maybe it's using a different Java version/installation when run outside of the IDE?
    – user330315
    Commented Nov 3, 2015 at 15:24
  • 1
    I updated both JDK and JRE to the lastest version. Now it doesn't work on the IDE...
    – dcubix
    Commented Nov 3, 2015 at 17:43
  • 1
    Java versions can sometimes cause a problem. For example, my game once worked fine on java 7 but broke on java 8. This appears more of an OpenGL problem, so I suggest you add the opengl tag.
    – Joehot200
    Commented Nov 4, 2015 at 13:56
  • 1
    Yeah, If I run it with Java 8 Update 25 it works just fine.
    – dcubix
    Commented Nov 4, 2015 at 15:51
  • 1
    Is it a maven project? If this is the case you might need to make assembly plugin in the pom.xml to create the jar with all the dependencies. When running from Netbeans the dependencies are automatically binded.
    – Yamada
    Commented Nov 13, 2015 at 13:21

1 Answer 1

4
+25

There are two possibilities. The first one is that your graphics card is out of date. In this case you should update your driver with a software of your card manufacturer(e.g. Nvidia, AMD, ...). This can only happen if you run it on a different machine. The second possibility is that your IDE-jre and you external jre have different versions. In this case you have to install the SAME version of the jre externally as you already have in NetBeans. DON'T update. Use an older version if NetBeans uses an older one.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.