Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (741)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (823)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Exporting to Runable Jar Gives Unsatisfied link eror  (Read 1765 times)
0 Members and 1 Guest are viewing this topic.
Offline Jay_PC

Senior Newbie

« Posted 2012-08-28 00:09:06 »

Im using lwjgl and Slick2d for a small application that I wish to export and send to a friend. (its a Mag Feeding timer for JP PSO2)

but when I export to Runable jar, it dosent work and when I go into the cmd and run it as java -jar MagTimer.jar it gives me a unsatisfied Link error, Which ive seen before... when I didnt know I needed to link the Natives in the build path. but I have and it runs fine in eclipse. How do i export to Jar WITH the natives and libraries?
Offline ReBirth
« Reply #1 - Posted 2012-08-28 01:26:32 »

Long time ago, there was a 16 years old piano player boy from Greek taught me this...

Configure your build path, make your all your required libs are checked on Export tab. Then on export, pick Jar file (first option, runnable jar is third) and select to extract required libs on folder alongside the jar (whatever, third option). You should get a jar and a directory containning libs with name youJarName_libs.

Offline ra4king

JGO Kernel

Medals: 506
Projects: 3
Exp: 5 years

I'm the King!

« Reply #2 - Posted 2012-08-28 03:41:36 »

Long time ago, there was a 16 years old piano player boy from Greek taught me this...
Not Greek, Egyptian! Grin

Add '-Djava.library.path="relative/path/to/natives/folder" to your command so it looks like this:
java -Djava.library.path="natives/windows/" -jar MagTimer.jar

For more info and options on how to run LWJGL applications, read this article I wrote on the LWJGL wiki:

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline gouessej
« Reply #3 - Posted 2012-08-28 06:17:36 »

Rather use Java Web Start. Some people might fail to run your game because your JAR will be opened by WinRAR or Arch... I'm too young to repeat the same things...

Julien Gouesse | Personal blog | Website | Jogamp
Offline kappa
« League of Dukes »

JGO Kernel

Medals: 119
Projects: 15


« Reply #4 - Posted 2012-08-28 08:51:10 »

If you just want an executable jar for your Slick2D application then you can use JarSplice to do this for you.

Export your project classes and resources (images, sound, etc) into a normal non runnable jar. Then run JarSplice, on the jar tab add your jar and all the external libraries you are using (lwjgl.jar, slick.jar, etc), add all the natives you are using on the native tabs, specify your main class and click to create an executable jar.

Additionally you can also use it to create platform specific executables (i.e. windows .exe files, OS X .app files, etc).
Offline ReBirth
« Reply #5 - Posted 2012-08-28 11:35:36 »

I kinda forgot Grin

Pages: [1]
  ignore  |  Print  

xxMrPHDxx (13 views)
2017-11-21 16:21:00

xxMrPHDxx (10 views)
2017-11-21 16:14:31

xxMrPHDxx (10 views)
2017-11-21 16:10:57

Ecumene (113 views)
2017-09-30 02:57:34

theagentd (148 views)
2017-09-26 18:23:31

cybrmynd (246 views)
2017-08-02 12:28:51

cybrmynd (242 views)
2017-08-02 12:19:43

cybrmynd (242 views)
2017-08-02 12:18:09

Sralse (257 views)
2017-07-25 17:13:48

Archive (875 views)
2017-04-27 17:45:51
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!