Monday, July 23, 2007

jMonkey App Distribution

Because I'm curious to see how my little jMonkey Engine application runs on a different machine, I decided to try packaging it up. I started by following the guide to using jME with NetBeans that I referenced in an earlier post. It got me most of the way there, but it has a few notable omissions.
  1. "Put all your images and 3D data files into JARs too." On my MacBook, this involved using Spotlight to find the image files referenced in my code and then manually copying the files into my project folder. I copied mine into the source directory, right next to the .java file, although I imagine you could put them elsewhere. Within seconds, the files appeared in my NetBeans project view. When I modified the textureState.setTexture calls I used the name of my game class and just the file name with no path (because the image files are in my source folder).
  2. Add the native LWJGL library to your dist folder. This tip I got from a discussion on the forum. For OS X, that file is liblwjgl.jnilib; I used Spotlight to find it.
  3. Add the native ODE library to your dist folder. Another tip from the forum. For OS X, the file is libodejava.jnilib.
Note that for the game to be cross-platform, the Windows and Linux flavors of the native LWJGL and ODE libraries should be included, too.

I'll try to update the wiki.

No comments: