Deployment Questions

Started by jessifin, January 04, 2014, 00:21:39

Previous topic - Next topic

jessifin

I've been working on a small game in LWJGL and want to be able to deploy it as a standalone, runnable JAR. You know, something that you can double click on and have run.
Don't get me wrong, making the jar isn't the hard part. I just don't know what the best option for loading natives is.

Ideally, I want to have a single download link and a single executable, not multiple downloads for different operating systems. I know it's trivial thing to get hung up on, but it's probably possible and I want to see how.

So there's this hidden switch for LWJGL that allows you to explicitly state the absolute path of the natives. It works fine if what you're pointing to is an actual file. As far as I understand, "files" inside of jars/zips are actually entries, and don't have their own file paths. PLEASE correct me if I'm wrong.

I would really like to use this hidden switch (it's very elegant), but as far as I see the only way I'd be able to make it work would be to copy the natives out of the jar (either temporarily or to some application support directory) and point there. I have no doubt that this works, but copying natives each time for execution makes no sense and under different operating systems the app support directories can get kinda weird.

Am I overlooking something, or is it simply impossible to use the hidden switch in this fashion?

Another option would be to make an applet and host the game on a website, making URLs an option. Then I could maybe use cookies to store the natives (I'm probably wrong, I've never used the java.net package).

Thanks,

jessifin


jessifin


Cornix

And they all state that its not possible to load a native library from a jar. Convinces me.

jessifin

Point taken. I'm just sad that it's not possible  :(

Cornix


kappa

You could can use a program like JarSplice to do it for you, it'll splice all your jars and natives into a single runnable jar (or .exe for windows, .app for mac, .sh for linux).

jessifin

Thanks! I've heard of Jarsplice, but I didn't know that it handled natives.