Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (600)
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 852 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: 356
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

@OP
Add '-Djava.library.path="relative/path/to/natives/folder" to your command so it looks like this:
1  
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: http://lwjgl.com/wiki/index.php?title=Distributing_Your_LWJGL_Application

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...

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 80
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 »

@ra4king
I kinda forgot Grin

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (29 views)
2014-12-15 09:26:44

Mr.CodeIt (20 views)
2014-12-14 19:50:38

BurntPizza (40 views)
2014-12-09 22:41:13

BurntPizza (75 views)
2014-12-08 04:46:31

JscottyBieshaar (37 views)
2014-12-05 12:39:02

SHC (50 views)
2014-12-03 16:27:13

CopyableCougar4 (47 views)
2014-11-29 21:32:03

toopeicgaming1999 (114 views)
2014-11-26 15:22:04

toopeicgaming1999 (102 views)
2014-11-26 15:20:36

toopeicgaming1999 (30 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org 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‑gaming.org
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!