0

I wrote my program in Java on OS X, and I am wanting to bundle my .JAR into a runnable .APP so I can distribute my program. I am running OS X 10.9, and I cannot find Apple's JarBundler.app on my machine. I looked at Oracles Jar Bundler solution and it requires a .plist for it. So my question is, how do I create the plist I need and can I manually build my .app?

Solution:

After enough tweaking I was finally able to get my java application to bundle and run as a .app.

   <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"     "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrefPaneIconFile</key>
<string>NotesClonerIcon.icns</string>
<key>Java</key>
<dict>
    <key>JVMVersion</key>
    <string>1.6+</string>
    <key>MainClass</key>
    <string>Notes_Cloner</string>
    <key>ClassPath</key>
    <string>$JAVAROOT/NotesCloner.jar</string>
    <key>Properties</key>
    <dict>
        <key>java.library.path</key>
        <string>$JAVAROOT/</string>
    </dict>
</dict>
<key>Properties</key>
<dict>
    <key>apple.laf.useScreenMenuBar</key>
    <string>true</string>
</dict>
<key>CFBundleExecutable</key>
<string>JavaApplicationStub</string>

    <key>CFBundleIconFile</key>
<string>NotesClonerIcon.icns</string>

<key>WorkingDirectory</key>
<string>$APP_PACKAGE/Contents/Resources/</string>

<key>CFBundleName</key>
<string>Notes Cloner Mac</string>

<key>CFBundleDisplayName</key>
<string>Notes Cloner Mac</string>

<key>NSPrefPaneIconLabel</key>
<string>Notes Cloner Preferences</string>

<key>CFBundleGetInfoString</key>
<string>Written By:Larry Wells </string>

<key>NSHumanReadableCopyright</key>
<string>Copyright © 2013, Larry Wells,All Rights Reserved.</string>

<key>CFBundleIdentifier</key>
<string>com.LarryWells.NotesClonerMac</string>

<key>CFBundleInfoDictionaryVersion</key>
<string>1.0</string>

<key>CFBundlePackageType</key>
<string>APPL</string>

<key>CFBundleShortVersionString</key>
<string>1.0.0</string>

<key>CFBundleSignature</key>
<string>????</string>

<key>CFBundleVersion</key>
<string>1.0.0</string>
</dict>
</plist>
Dr-ZoidBerg
  • 41
  • 3
  • 10
  • This might help: http://stackoverflow.com/questions/14917908/convert-java-to-app-file-for-macosx-using-jarbundler – CodeChimp Dec 10 '13 at 14:47
  • How do you intend to deploy it for Windows and *nix users? – Andrew Thompson Dec 10 '13 at 15:02
  • @AndrewThompson This application is specifically targeted for OS X users. I initially created this app on Windows in C#, and recently decided it would benefit me if I used this app on OS X. – Dr-ZoidBerg Dec 11 '13 at 16:23
  • *"This application is specifically targeted for OS X users."* I wouldn't use Java for that. OS X has a rich set of APIs specifically designed for OS X. And even using the native PLAF, and deployed with an app. bundle, the typical Mac use can tell the difference between the two, and dislike the Java side of it. – Andrew Thompson Dec 13 '13 at 03:39

1 Answers1

0

See original post for solution. I just kept trying different plist keys and strings until one finally worked. I believe I am running into admin issues now, because parts of my program will not work. I will be creating a new question for that issue.

Dr-ZoidBerg
  • 41
  • 3
  • 10