Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LWJGL won't work outside NetBeans

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!

like image 431
dcubix Avatar asked Nov 03 '15 15:11

dcubix


People also ask

What version of OpenGL does Lwjgl use?

OpenGL® Bindings LWJGL supports all OpenGL versions (including the latest 4.6 specification), all ARB, Khronos, and OS-specific extensions ever released and dozens of popular vendor-specific extensions. If your favorite extension is missing, ask for it and it will be added in no time!

Does Lwjgl use Glfw?

GLFW is the preferred windowing system for LWJGL 3 applications.

Is Lwjgl an engine?

Frameworks & Game Engines using LWJGL jMonkeyEngine is a 3D game engine for adventurous Java developers. It's open-source, cross-platform, and cutting-edge. The engine is used by several commercial game studios and computer-science courses.


1 Answers

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.

like image 58
Dynamitos Avatar answered Oct 01 '22 07:10

Dynamitos