Using Jar Bundler on Mac OSX

Started by elias4444, November 13, 2006, 16:21:26

Previous topic - Next topic

elias4444

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?
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

Jon

I am running into the same problem and cannot find a way to fix it...

Sormuras

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