So, I've been working on this 3D game engine for about a week now and everything's been great, I love GLFW and so on. Well, yesterday I thought I should try running the game engine under a Debian Wheezy x64 VM, I built it and packaged it into a zip with native linux libraries and sent it over to my linux vm. I installed OpenJDK 8 on the virtual machine and tried running the program and this "java.lang.reflect.InvocationTargetException" comes up before the program gets to do anything.
Is this a common issue? I've been trying but can't seem to be able to fix it. I've tried building it with JDK7 and running on JDK7 or JDK8, no luck, always this same error.
Here's the exception in it's full glory;
harha@deb-x64vm:~/Desktop/mirageengine$ java -jar mirage.jar
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at org.lwjgl.LWJGLUtil.loadLibrarySystem(LWJGLUtil.java:337)
at org.lwjgl.Sys.<clinit>(Sys.java:29)
at org.lwjgl.LWJGLUtil.initialize(LWJGLUtil.java:309)
at org.lwjgl.system.MemoryUtil.<clinit>(MemoryUtil.java:35)
at org.lwjgl.Pointer.<clinit>(Pointer.java:22)
at org.lwjgl.PointerBuffer.<init>(PointerBuffer.java:24)
at org.lwjgl.PointerBuffer.allocateDirect(PointerBuffer.java:281)
at org.lwjgl.BufferUtils.createPointerBuffer(BufferUtils.java:190)
at org.lwjgl.system.libffi.Closure.<clinit>(Closure.java:45)
at org.lwjgl.glfw.Callbacks.errorCallbackPrint(Callbacks.java:129)
at io.github.harha.mengine.core.CoreEngine.init(CoreEngine.java:55)
at io.github.harha.game.Main.main(Main.java:17)
... 5 more
I honestly can't figure out what causes this, been googling the exception, etc... I don't understand why it whines about a wrong lwjgl path, the natives are in the same folder as the jar, just like on windows, and on windows that works fine. And I remember in LWJGL 2.x building a project like this worked fine for linux builds as well.
Edit:
Well, I tried system.setproperty for the native library path by setting it to "./" and that seems to have gotten rid of that error, but still the same InvocationTargetException comes up, this time whining the display handle was 0, so display failed to set-up.
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.RuntimeException: Failed to create the requested GLFW window context.
at io.github.harha.mengine.rendering.Window.init(Window.java:45)
at io.github.harha.mengine.core.CoreEngine.init(CoreEngine.java:58)
at io.github.harha.game.Main.main(Main.java:19)
... 5 more
...