Bundled app launcher changes

Tobias Bley tobi at ultramixer.com
Wed Feb 15 22:27:23 PST 2012


It's great to see there is a new ant task to create app bundles. But I'm a little bit confus: What is currently the right way to create a java app bundled with a privat jre of OpenJDK7? Is it the new ant task (where can I download it?) or is it the JavaAppLauncher code from Mike/Apple?

Best regards,

UltraMixer Digital Audio Solutions

Am 10.02.2012 um 13:25 schrieb Greg Brown:

> Hi all,
> Here's an updated version of the sample Ant task Scott sent earlier. The task has been renamed to "bundleapp" rather than "bundlejars", and the <jarfile> element has been replaced with <classpath>, which is now a file set that can point to either class directories or JAR files:
>    <bundleapp outputdirectory="."
>        name="SwingSet2"
>        displayname="SwingSet 2"
>        identifier="com.oracle.javax.swing.SwingSet2"
>        shortversion="1.0"
>        runtime="${env.JAVA_HOME}/../.."
>        mainclassname="SwingSet2">
>        <classpath file="/Library/Java/Demos/JFC/SwingSet2/SwingSet2.jar"/>
>        <option value="-Xms32M"/>
>        <option value="-Xmx256M"/>
>        <option value="-Dapple.laf.useScreenMenuBar=true"/>
>        <argument value="foo=bar"/>
>    </bundleapp>
> Other changes include:
> - "destDir" attribute renamed "outputdirectory"
> - "mainclass" attribute renamed "mainclassname"
> - <property> element renamed <option>; now specified using single "value" attribute rather than "name" and "value"
> Finally, the launcher stub has been updated as outlined below to use JLI_Launch().
> Questions and comments are welcome.
> Greg
> On Jan 30, 2012, at 12:30 PM, Scott Kovatch wrote:
>> Hello,
>> Greg Brown has been busy working on an Ant task for creating a Mac .app bundle. As a preview, here's an example of it in use:
>>      <bundlejars destDir="."
>>          name="SwingSet2"
>>          displayname="SwingSet 2"
>>          identifier="com.oracle.javax.swing.SwingSet2"
>>          icon="JavaAppLauncher/resources/GenericApp.icns"
>>          shortversion="1.0"
>>          runtime="${env.JAVA_HOME}/../.."
>>          mainclass="SwingSet2">
>>          <jarfile path="/Library/Java/Demos/JFC/SwingSet2/SwingSet2.jar"/>
>>          <argument value="-Xms32M"/>
>>          <argument value="-Xmx256M"/>
>>          <property name="apple.laf.useScreenMenuBar" value="true"/>
>>      </bundlejars>
>> I'm wondering where this should be checked in, though. Building an application bundle from JARs, resources, and launcher stub is really a deployment task as opposed to a pure JDK feature, but Web Start and the plugin are not open sourced so I don't see a public 'deploy' project happening in the near future. We definitely want to push this out so people can start building applications with the Mac JDK. Anyone have an opinion on that?
>> Also, we are working on an simpler version of the launcher code that will reuse more of the generic/command-line launcher code in jdk/src/share/bin/java.c. Kumar Srinivasan checked in a refactoring of the command-line tools so that all of the runloop management, argument parsing, and other setup is now done in JLI_Launch. That means we can rip out the code that duplicates that work in the app launcher and call through to JLI_Launch instead.  I started on this and handed it off to Greg. We should have something to share in the next week or so.
>> -- Scott K.
>> ----------------------------------------
>> Scott Kovatch
>> scott.kovatch at oracle.com
>> Santa Clara/Pleasanton, CA

More information about the macosx-port-dev mailing list