简体   繁体   English

LWJGL不会在NetBeans之外工作

[英]LWJGL won't work outside NetBeans

I'm having trouble trying to figure out why my LWJGL3 application won't run outside NetBeans. 我无法弄清楚为什么我的LWJGL3应用程序不能在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: 作为Jar,如果我直接从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. 图形驱动程序更新,应用程序工作,如果我从IDE运行,所有的DLL都在那里,我不知道是什么原因造成的。

Any help will be appreciated, thanks in advance! 任何帮助将不胜感激,提前感谢!

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(eg Nvidia, AMD, ...). 在这种情况下,您应该使用卡制造商的软件更新驱动程序(例如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. 第二种可能性是你的IDE-jre和你的外部jre有不同的版本。 In this case you have to install the SAME version of the jre externally as you already have in NetBeans. 在这种情况下,您必须像在NetBeans中一样在外部安装jre的SAME版本。 DON'T update. 不要更新。 Use an older version if NetBeans uses an older one. 如果NetBeans使用旧版本,请使用旧版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM