2
\$\begingroup\$

Hello I made a simple game and I want to share it to my friend but he cant run it. I'm assuming it's because he has windows 10 and the LWJGL 2 native files don't support that (I've asumed that based on the .bat run file (a standard Java -jar a.jar line) wich crashed right before it is supposed to initialize windows 10). Maybe that isn't the problem but I don't see any other issue. Do the native files support newer systems? If not, then could you give me suggestions on getting new native files or something. Thanks

\$\endgroup\$
4
  • 1
    \$\begingroup\$ What does the errormessage in the console say? \$\endgroup\$
    – tkausl
    Commented Oct 23, 2015 at 20:31
  • \$\begingroup\$ Why not run the .jar \$\endgroup\$
    – dimitris93
    Commented Oct 23, 2015 at 20:32
  • \$\begingroup\$ I dont exactly remember the error message but it was something like: didnt load libraries. And he did run it through the jar file but when it crashes you dont know why, in cmd it says whats happening \$\endgroup\$
    – Ivan Jerza
    Commented Oct 23, 2015 at 20:36
  • \$\begingroup\$ Have you set the -Djava.library.path switch? Relevant: Distributing Your LWJGL Application \$\endgroup\$ Commented Oct 23, 2015 at 21:14

1 Answer 1

1
\$\begingroup\$

What you have probably overlooked is the -Djava.library.path flag. This is a flag that must be set when running the java command to tell the JVM where the native files are located. Let's say you have this file hierarchy:

  • natives/ (*.dll, *.so)
  • yourGame.jar

You'd want to run the .jar with the following command:

java -Djava.library.path="natives/" -jar yourGame.jar

Make sure that you export the .jar as a "Runnable JAR File" so that all libraries are included.

You didn't need to do this setup on your own computer because you've already imported the native files in your IDE. When distributing your game though, I suggest a file with the given java command and a pause command (on Windows) so that the person who runs the game can easily send you a screenshot or copy-paste of any error or debugging information.

Source: Distributing Your LWJGL Application

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .