r/LWJGL • • Jun 25 '23

.jar problem!

There is a project in Eclipse, it is a game with Java LWJGL, it works fine in Eclipse, but after exporting to a runnable jar. It won't launch, I already checked Launch4j, JarSplice no result!

How to run .jar**?**

2 Upvotes

7 comments sorted by

0

u/[deleted] Jun 26 '23

[deleted]

1

u/Tirezor Jun 26 '23

i get this: Unable to access jarfile

0

u/[deleted] Jun 26 '23

[deleted]

1

u/Tirezor Jun 26 '23

Do I only need to write the file name or do you also need to write the file path?

0

u/[deleted] Jun 26 '23

[deleted]

1

u/Tirezor Jun 26 '23

I wrote with the path of the file, and the output "Hello World!" was successful, but the window from LJWGL did not open, and the error Exception in thread "main" java.lang.reflect.InvocationTargetException appeared

0

u/[deleted] Jun 26 '23

[deleted]

1

u/Tirezor Jun 26 '23

Hello World !

Exception in thread "main" java.lang.reflect.InvocationTargetException

at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119)

at java.base/java.lang.reflect.Method.invoke(Method.java:578)

at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:61)

Caused by: java.lang.UnsatisfiedLinkError: no lwjgl64 in java.library.path: C:\Program Files\Java\jdk-20\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\WorldPainter;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\dotnet\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\myname\AppData\Local\Microsoft\WindowsApps;C:\Users\myuser\.dotnet\tools;C:\Users\myuser\AppData\Local\Programs\Microsoft VS Code\bin;;.

at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2444)

at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:880)

at java.base/java.lang.System.loadLibrary(System.java:2051)

at org.lwjgl.Sys$1.run(Sys.java:72)

at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)

at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)

at org.lwjgl.Sys.loadLibrary(Sys.java:87)

at org.lwjgl.Sys.<clinit>(Sys.java:117)

at org.lwjgl.opengl.Display.<clinit>(Display.java:135)

at com.mygame.gameengine.window.Window.init(Window.java:45)

at com.mygame.gameengine.window.Window.run(Window.java:38)

at com.mygame.main.Main.main(Main.java:14)

at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)

... 2 more

PS C:\Users\myuser>

0

u/[deleted] Jun 26 '23

[deleted]

1

u/Tirezor Jun 26 '23

When I open the .jar with zip, there are lwjgl files, and when exporting in Eclipse, I selected package required libraries into generated jar(Runnable jar), but I don't know what to do about the native files

1

u/Tirezor Jun 26 '23

Dude!!! When I moved the .jar file to the native files folder, everything worked, but how do I change the path to those files?

→ More replies (0)