I have problems with the .app file. On an empty mac os x mountain lion (10.8.4), a request to install java 6 is launched in my application.
So the first question: why java 6? Why not java 7? What is wrong with my application file?
Image: http://postimg.org/image/747o37od7/
Created using appBundler. build.xml
<project name="AppBundler" default="default" basedir="."> <taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="lib/appbundler-1.0.jar" /> <target name="AppBundler"> <bundleapp outputdirectory="dist" name="AppBundler" displayname="AppBundler" identifier="lt.launcher.MacLauncher" mainclassname="lt.launcher.MacLauncher"> <classpath file="lib/launcher.jar" /> <option value="-Xdock:icon=Contents/Resources/${bundle.icon}"/> <option value="-Dforce.new.vm=true"/> <option value="-Dapple.laf.useScreenMenuBar=true"/> <option value="-Dforce.new.vm=true"/> <option value="-Dcom.apple.macos.use-file-dialog-packages=true"/> <option value="-Dcom.apple.macos.useScreenMenuBar=true"/> <option value="-Dcom.apple.mrj.application.apple.menu.about.name=AppBundler"/> </bundleapp> </target> </project>
Info.plist:
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleExecutable</key> <string>JavaAppLauncher</string> <key>CFBundleIconFile</key> <string>GenericApp.icns</string> <key>CFBundleIdentifier</key> <string>lt.launcher.MacLauncher</string> <key>CFBundleDisplayName</key> <string>AppBundler</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>AppBundler</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>1</string> <key>NSHumanReadableCopyright</key> <string></string> <key>JVMMainClassName</key> <string>lt.launcher.MacLauncher</string> <key>JVMOptions</key> <array> <string>-Xdock:icon=Contents/Resources/${bundle.icon}</string> <string>-Dforce.new.vm=true</string> <string>-Dapple.laf.useScreenMenuBar=true</string> <string>-Dforce.new.vm=true</string> <string>-Dcom.apple.macos.use-file-dialog-packages=true</string> <string>-Dcom.apple.macos.useScreenMenuBar=true</string> <string>-Dcom.apple.mrj.application.apple.menu.about.name=AppBundler</string> </array> <key>JVMArguments</key> <array> </array> </dict> </plist>
NOTE : I do not want to bind Java inside the application file. Because I don’t think it’s good practice to add it inside. When your .jar size is 1 MB and the application file will be 140 + MB due to the associated java.
I am experimenting with appBundler, and sometimes when I create the .app file, I get:
Image: http://postimg.org/image/6xxju2aw1/
So another question is how to create a .app file that requires java 7 to be installed and when the application starts, if java 7 is not installed, it will prompt you to download and install java 7?
I read a lot of tutorials / tutorials on creating the .app file, but so far have not been able to get it to work the way I want.
Any advice is appreciated!
Does the application use Java 6 from Apple instead of Java 7 from Oracle on Mac OS X?
source share