LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: elias4444 on November 13, 2006, 16:21:26

Title: Using Jar Bundler on Mac OSX
Post by: elias4444 on November 13, 2006, 16:21:26
Now that I finally have a Mac to develop on, I wanted to use the Jar Bundle utility to put my games into a .app file. I can't seem to figure out how to set the java.library.path correctly though. Anyone have any experience with this?
Title: Using Jar Bundler on Mac OSX
Post by: Jon on November 26, 2006, 23:04:07
I am running into the same problem and cannot find a way to fix it...
Title: Using Jar Bundler on Mac OSX
Post by: Sormuras on November 27, 2006, 08:14:29
Hi!

I dropped the Jar Bundler by a manual Ant target, that creates/copies the Mac .app structure. The basis I used is this demo game from PuppyGames: http://www.puppygames.net/downloads/TitanAttacks_MacOSX.zip

Here's an excerpt from the build.xml:

 <!-- MAC OSX -->
 <target name="dist-mac-osx" depends="dist">
   <mkdir dir="${dist}/mac-osx" />
   <mkdir dir="${dist}/mac-osx/Game.app" />
   <mkdir dir="${dist}/mac-osx/Game.app/Contents" />
   <copy todir="${dist}/mac-osx/Game.app/Contents">
     <fileset dir="build/macosx" />
   </copy>
   <copy todir="${dist}/mac-osx/Game.app/Contents/Resources/Java">
     <fileset dir="${dist}">
       <include name="Game.jar" />
     </fileset>
     <fileset dir="../3rd-party/org.lwjgl/native/macosx">
       <include name="liblwjgl.jnilib" />
       <include name="openal.dylib" />
     </fileset>
   </copy>
   <tar destfile="${dist}/Game-macosx.tar.gz" compression="gzip">
     <tarfileset dir="${dist}/mac-osx" excludes="**/JavaApplicationStub" />
     <tarfileset dir="${dist}/mac-osx/Game.app/Contents/MacOS" prefix="Game.app/Contents/MacOS" mode="755" includes="JavaApplicationStub" />
   </tar>
 </target>


Be sure to edit the Info.plist file and remember, that ZIP loses the executable flag which is need for the JavaApplicationStub.

Hope that helps,
Sor