Hello Guest

[Solved] Same code and 2 different erros

  • 2 Replies
[Solved] Same code and 2 different erros
« on: June 28, 2018, 13:56:13 »
Version: LWJGL 3.1.6 build 14

All was working well before I exported one of my projects. When I ran the jar file it didn't work. So I tried IDE (Eclipse) and it gave me this error:

Code: [Select]
Exception in thread "main" java.lang.IllegalStateException: There is no OpenGL context current in the current thread.
   at org.lwjgl.opengl.GL.createCapabilities(GL.java:376)
   at org.lwjgl.opengl.GL.createCapabilities(GL.java:320)
   at HelloWorld.loop(HelloWorld.java:95)
   at HelloWorld.run(HelloWorld.java:25)
   at HelloWorld.main(HelloWorld.java:114)

I changed nothing before and after exporting and it just stopped working.
So I copied code from https://www.lwjgl.org/guide and still the same.
I took the jar and tried it on another PC and it worked! (My is WIN7 other is WIN10)
Could it be hardware issue or some wrong settings ?

Running the jar file with console gives me this error:
Code: [Select]
Exception in thread "main" java.lang.ExceptionInInitializerError
        at com.steve6472.sge.main.MainApplication.preLoop(MainApplication.java:141)
        at com.steve6472.sge.main.MainApplication.run(MainApplication.java:354)
        at com.steve6472.sge.main.MainApplication.<init>(MainApplication.java:69)
        at com.steve6472.utils.UtilsMain.<init>(UtilsMain.java:26)
        at com.steve6472.utils.UtilsMain.main(UtilsMain.java:128)
Caused by: java.lang.NullPointerException
        at org.lwjgl.system.Checks.check(Checks.java:99)
        at org.lwjgl.system.Pointer$Default.<init>(Pointer.java:52)
        at org.lwjgl.system.SharedLibrary$Default.<init>(SharedLibrary.java:18)
        at org.lwjgl.system.windows.WindowsLibrary.<init>(WindowsLibrary.java:32)
        at org.lwjgl.system.APIUtil.apiCreateLibrary(APIUtil.java:122)
        at org.lwjgl.system.Library.loadNative(Library.java:329)
        at org.lwjgl.system.Library.loadNative(Library.java:313)
        at org.lwjgl.system.Library.loadNative(Library.java:221)
        at org.lwjgl.system.Library.loadNative(Library.java:187)
        at org.lwjgl.system.Library.loadNative(Library.java:356)
        at org.lwjgl.opengl.GL.create(GL.java:109)
        at org.lwjgl.opengl.GL.<clinit>(GL.java:85)
        ... 5 more
« Last Edit: June 29, 2018, 09:00:31 by steve6472 »


Offline spasi

  • *****
  • 2216
    • WebHotelier
Re: Same code and 2 different erros
« Reply #1 on: June 29, 2018, 08:12:47 »
Looks like the OpenGL .dll is missing. Run the application with -Dorg.lwjgl.util.Debug=true -Dorg.lwjgl.util.DebugLoader=true to verify. Reinstalling the GPU drivers may resolve the issue.

Re: Same code and 2 different erros
« Reply #2 on: June 29, 2018, 08:59:35 »
Deleting C:\Users\{Name}\AppData\Local\Temp\lwjgl{Name} somehow helped.
Thank you for showing me the debug arguments thus helping me fix my problem.