J2ME: Build package with antenna

I use IDEA 3.0.5, ant 1.5.1 (1.6.1), and new antenna, WTK2.1
There is example build.xml from Master jimmack

When I build package (JAR/JAD) with NDS 2.2 for J2ME, package is worked properly.

I don`t understand how ant make (build) all tasks. I can do it, only if I set depends for target.
In second, my JAR is bad. When I build JAR with Nokia DevSuit JAR work properly, but when I run ant (from command line or via IDEA) JAR is bad.
After start midlet phone (or emulator) generate exception:
"A class was not fount during execution. It is possible that preberifying has failed. If you compiled the classes using J2SDK 1.4.1 or later, please check that you used compiler option "-target 1.1",which generates class files gor for all Java SDKs. Also note that the default emulator used for  preverifying must support the APIs which are used by classes in the ckass path."

In task wtkbuild target = 1.1

My package task
<wtkpackage jarfile="${MIDlet-Name}.jar" jadfile="${MIDlet-Name}.jad" basedir="${ProjDir}/classes">
      <fileset dir="${ProjDir}/res"/>
        <attribute name="Built-By" value="${user.name}"/>
        <attribute name="MicroEdition-Configuration" value="${ME-Conf}"/>
        <attribute name="MIDlet-Name" value="${MIDlet-Name}"/>
        <attribute name="MIDlet-Icon" value="/${MIDlet-Icon}"/>
        <attribute name="MIDlet-Version" value="${MIDlet-Version}"/>
        <attribute name="MIDlet-Vendor" value="${MIDlet-Vendor}"/>
        <attribute name="MIDlet-1" value="${MIDlet-Name}, /${MIDlet-Icon}, ${MIDlet-Class}"/>
        <attribute name="MicroEdition-Profile" value="${ME-P}"/>
Who is Participating?
I can't under stand this statment "I don`t understand how ant make (build) all tasks. I can do it, only if I set depends for target"

Second ur ant build.xml must do the following:

1- Preverify after compiling the classes
2- package the JAR with the right MANIFEST.MF that its attributes match the correspondnet in urapp.jad file
3- the JAD file msut contain the right jar size in attribute MIDlet-Jar-Size

refer to the build.xml of the smart ticket demo at:


good luck
yobserAuthor Commented:
I mean "make all target, if I don`t set depends". I know answer ;-) NOHOW

I`ll attempt your link.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.