Skip to main content

Packaging issue on OSX

No replies
lanthale
Offline
Joined: 2010-01-19
Points: 0

I wanted to try the packaging mechanism of JDK 8 b91 with the ant target fx:deploy. So I checked out an open source software (mucommander) and tried to build it with the actual build file from them. All was fine and I got a running .jar file at the end. Now I created a new target called "fxapp" to build a native executable on OSX. Again I got a .app but if I start the app the app is loaded twice. I tried again the containing .jar file and got only one instance of the app loaded.

Could there be a bug in JDK 8 Launcher to load an app always twice or is it just a ant issue ?

Here is the part of the build.xml I have used to create the native executable:

<target name="fxapp" depends="jar"> 
        <taskdef resource="com/sun/javafx/tools/ant/antlib.xml" 
                uri="javafx:com.sun.javafx.tools.ant"
                classpath="/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/ant-javafx.jar"/>

        <!-- Mark application as Swing-based -->
        <fx:application name="muCommander" id="muCommanderID" mainClass="${app.main}" toolkit="swing"/>                

       <!-- generate JNLPs, HTML and native bundles -->
       <fx:deploy verbose="true" width="960" height="720" includeDT="true"
                  nativeBundles="image"
                  outdir="${dist}" embedJNLP="false"
                  outfile="muCommander" >
            <fx:application name="muCommander" id="muCommanderID" mainClass="${app.main}" toolkit="swing"/>          
            <fx:resources>
                <fx:fileset type="jar" dir="${tmp}" includes="mucommander-normal.jar"/>
            </fx:resources>
            <fx:permissions/>
            <fx:platform>           
                    <fx:property name="java.system.class.loader"
                            value="com.mucommander.commons.file.AbstractFileClassLoader"/>
                    <fx:property name="com.apple.smallTabs"          value="true"/>
                    <fx:property name="com.apple.hwaccel"            value="true"/>
                    <fx:property name="apple.laf.useScreenMenuBar"   value="true"/>
                    <fx:property name="file.encoding"                value="UTF-8"/>   
                    <fx:property name="-Xmx" value="128m"/>
            </fx:platform>
            <fx:info title="App: muCommander"
                  vendor="muCommander">
                  <fx:icon href="./res/package/osx/icon.icns"></fx:icon>
             </fx:info>    
        </fx:deploy>
    </target>