1

I have written ANT script to preverify the classes.,

 <property name="wtkHome" location="C:/WTK2.5.2"> </property>
 <property name="midp_lib" value="${wtkHome}/lib/midpapi21.jar"></property>
   .... 
  ........
<property name="build" value="build"/>
.....
   ......    

    <target name="preverify">
            <mkdir dir="${build}/preverified"/>
                <exec executable="${wtkHome}/bin/preverify">
                  <arg line="-classpath ${wtkHome}/lib"/>
             (or) <arg line="-classpath ${midp_lib}"/>
                  <arg line="-d ${build}/preverified"/>
                  <arg line="${build}/classes"/>
                </exec>
        </target>

When the above script executes, it is not able to find the midp classes in the classpath, so it's showing the error,

[exec] Error preverifying class first.MCCanvas
[exec] java/lang/NoClassDefFoundError: javax/microedition/lcdui/Canvas
[exec] Result: 1

But the required libraries are in the classpath, Please note compilation is fine for the MIDlet and Canvas classes!

Cœur
  • 37,241
  • 25
  • 195
  • 267
Murugesh
  • 1,009
  • 1
  • 12
  • 34

2 Answers2

1

Why don't you use Antenna? http://antenna.sourceforge.net/

Your build script would use:


    <wtkpreverify cldc="CLDC-1.0" srcdir="${build}/classes" destdir="${build}/preverified" classpath="${wtk.home}/lib/cldcapi11.jar;${wtk.home}/lib/midpapi20.jar" />

Telmo Pimentel Mota
  • 4,033
  • 16
  • 22
  • Thanks for your suggestion, I'm trying to write own build script. And the problem got resolved by specifying the whole jar location – Murugesh Jun 25 '12 at 09:49
0

Try with backslashes "\"

<arg line="-classpath C:\WTK2.5.2\lib\midpapi21.jar"/>
oxigen
  • 6,263
  • 3
  • 28
  • 37