Anonymous - 2012-11-03


I think one-jar is an excellent tool for creating jar files. However I am currently encountering a problem when executing it using Windows.

In Windows when i execute the jar, I would get

  java.lang.NoClassDefFoundError: com/simontuffs/onejar/Boot
      Caused by: java.lang.ClassNotFoundException: com.simontuffs.onejar.Boot
      at Method)
      at java.lang.ClassLoader.loadClass(
      at sun.misc.Launcher$AppClassLoader.loadClass(
      at java.lang.ClassLoader.loadClass(
      Could not find the main class: com.simontuffs.onejar.Boot. Program will exit.
      Exception in thread "main"
      Java Result: 1

In Mac, the application would run normally,
The ant build code that I have is

     <target name="onejar" depends="jarFile">  
        <taskdef name="one-jar"
                     classpath="${external.jar}/onejar.jar" />
      <!-- Construct the One-JAR file -->     
<one-jar destfile="${build.dir}/jar/FinalMinitron.jar">  
             <main jar="${build.dir}/jar/Minitron.jar">  
            <attribute name="Main-Class" value=""/>   
            <attribute name="Class-Path" value="${nxj.home}/lib/nxt/classes.jar;${nxj.home}/lib/pc/pccomm.jar"/>
                <fileset dir="${}">
                    <include name="**/*.class"/>
                 <fileset dir="${external.jar}" />
                <fileset dir="${lejosPC}">
                    <include name="**/*.jar"/>
                <fileset dir="${lejosNXT}">
                <include name="**/*.jar"/>

Can anyone out there offer me some advice on where did i go wrong for this in Windows? I uses the same script in Mac and I don't have a single problem on this.