Link to home
Start Free TrialLog in
Avatar of yobser
yobser

asked on

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
 https://www.experts-exchange.com/questions/20971796/J2me-Gaming-Problem-with-Creating-build-jar-for-nokia-phones.html#10949699

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"/>
      <manifest>
        <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}"/>
      </manifest>
    </wtkpackage>
ASKER CERTIFIED SOLUTION
Avatar of petmagdy
petmagdy
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of yobser
yobser

ASKER

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

I`ll attempt your link.