1

I am trying to use Jarbundler to package my Java application to be used on Mac.

As the application is a maven based application I used mvn ant:ant command to convert it to ant; However, when I run it returns an error as following:

    Error: Could not find or load main class com.myproject.swing.Main

build.xml

<?xml version="1.0" encoding="UTF-8"?>

<project name="MyApp" default="package" basedir=".">

  <import file="maven-build.xml"/>

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

    <target name="MyApp">
        <bundleapp outputdirectory="dist"
            name="MyApp"
            displayname="MyApp"
            identifier="com.myproject.swing.Main"
            mainclassname="com.myproject.swing.Main">
            <classpath file="dist/MyApp.jar" />
        </bundleapp>
    </target>
  <!-- ====================================================================== -->
  <!-- Help target                                                            -->
  <!-- ====================================================================== -->

  <!-- <target name="help">
    <echo message="Please run: $ant -projecthelp"/>
  </target> -->

</project>

*The main class is located in following address

src > main > java > com > myproject > swing > Main

Compiler compliance level is 1.8

Jack
  • 6,430
  • 27
  • 80
  • 151
  • what command did you use to run it? and use 'jar -tvf MyApp.jar' to check the structure of the jar. – Dongqing Feb 04 '15 at 07:58
  • @Dongqing Once it successfully packaged the app, I clicked on the icon to run it. As I could not run it, clicked on the generated file. – Jack Feb 05 '15 at 00:09

0 Answers0