Java swing app in Mac won't start

229 views Asked by At

I made an app in netbeans and build my project to create a jar file. When I double click on jar file the app get started without any problem. Now I packaged the app using appbundler. I follow every instruction from here.

I issued the command ant bundle-filemanager and FileManager.app is appeared in dist directory. Here is the build.xml

project name="File_Manager" default="default" basedir=".">
    <description>Builds, tests, and runs the project File Manager.</description>
    <import file="nbproject/build-impl.xml"/>

    <property environment="env" />

    <taskdef name="filemanager"
             classname="com.oracle.appbundler.AppBundlerTask"   
             classpath="lib/appbundler-1.0.jar" />

    <target name="bundle-filemanager">
        <filemanager outputdirectory="dist"
                     name="FileManager"
                     displayname="File Manager"
                     identifier="file.manager.MainActivity"
                     mainclassname="file.manager.MainActivity">
            <runtime dir="${env.JAVA_HOME}" />
            <classpath file="dist/File_Manager.jar" />
        </filemanager>
    </target>
</project>

Now if I double click on FileManager.app it won't start. Just show icon in dock for a second and get disappear from dock.

You can also see the source code here

0

There are 0 answers