×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    May 2004
    Posts
    11

    Make jar with ant file. Please Help !!!

    Hi,

    I try to package my project with an ant file but I can't.

    I use Jbuilder Enterprise 9 + SDK S40 DP2.0. With the SDK comes an built.xml to make the init, javacompile, etc, but not to package.

    I use the sample, that I transcript down, who comes with the antenna distribution, but it doesn't work.

    Can anybody help me ?

    <?xml version="1.0" encoding="iso-8859-1" ?>
    <project name="hello" default="build" basedir=".">
    <property name="wtk.home" value="c:\Java\wtk-1.0.4"/>
    <taskdef resource="antenna.properties"/>
    <target name="build">
    <wtkjad jadfile="hello.jad" jarfile="hello.jar" name="Hello"
    vendor="Joerg Pleumann" version="1.0.0">
    <midlet name="Hello" class="Main"/>
    </wtkjad>

    <delete dir="classes"/>
    <mkdir dir="classes"/>

    <wtkbuild srcdir="src" destdir="classes" preverify="false"/>

    <wtkpackage jarfile="hello.jar" jadfile="hello.jad"
    obfuscate="false" preverify="false">

    <fileset dir="classes"/>
    </wtkpackage>

    <wtkpreverify jarfile="hello.jar"
    jadfile="hello.jad"/>

    <wtkmakeprc jadfile="hello.jad" jarfile="hello.jar"
    prcfile="hello.prc"/>

    <wtkrun jadfile="hello.jad" device="DefaultColorPhone" wait="true"/>

    </target>

    </project>

  2. #2
    Registered User
    Join Date
    May 2004
    Posts
    12

    error message?

    what error message are you getting?

    check the FAQ here:

    http://www.j2x.ca/developer/faq.php

  3. #3
    Regular Contributor
    Join Date
    Jun 2003
    Location
    Hungary
    Posts
    414
    Here is a working target example:
    Code:
    <target name="build_ns60_full">
    	<property name="application" value="Granodus - elemental invasion - full - Nokia S60"/>
    	<wtkjad
    		jadfile="./bin/granodus_ei_full_ns60.jad"
    		jarfile="./bin/granodus_ei_full_ns60.jar"
    		manifest="manifest.mf"
    		update="false"
    		name="Granodus - EI"
    		vendor="kisemberSoftware"
    		version="2.0.0">
    			<midlet name="Granodus - EI" icon="/i.png" class="Application"/>
    			<attribute name="MIDlet-Icon" value="/i.png"/>
    			<attribute name="MIDlet-Data-Size" value="1024"/>
    			<attribute name="MIDlet-Description" value="platform game"/>
    	</wtkjad>
                  
    	<delete dir="classes_granodus_ei_full_ns60"/>
    	<mkdir dir="classes_granodus_ei_full_ns60"/>
    	
    	<wtkbuild srcdir="src"
    		destdir="classes_granodus_ei_full_ns60"
    		preverify="false"
    		bootclasspath="${nokia.ui.classes}"
    	/>
    
    	<wtkpackage
    		jarfile="./bin/granodus_ei_full_ns60.jar"
    		jadfile="./bin/granodus_ei_full_ns60.jad"
    		config="CLDC-1.0" profile="MIDP-1.0"
    		autoversion="false" obfuscate="true"
    		preverify="true" verbose="true"
    		bootclasspath="${nokia.ui.classes}"
    	>
    		<fileset dir="./classes_granodus_ei_full_ns60"/>
    		<fileset dir="./res" includes="w.png n.png"/>
    	</wtkpackage>
    </target>

  4. #4
    Registered User
    Join Date
    May 2004
    Posts
    11

    I'm still trying to make my jar.

    Thank you both for you reply.

    sjbrown0, I check the FAQ that you suggest, I follow the steps that they recommend, but doesn't work for me.

    kisember, I try to apply your example but still have the same error.

    The message is Preverification failed (result=1)

    I'm still trying to make my jar.

    Regards

  5. #5
    Regular Contributor
    Join Date
    Jun 2003
    Location
    Hungary
    Posts
    414
    Are you sure that you specify the appropriate bootclasspath in the tasks?

    I had problems with preverify jar files this is why I did it in the wtkpackage task.

  6. #6
    Registered User
    Join Date
    May 2004
    Posts
    12
    Here are some tips that have been helpful for that error.

    * maybe there are some old files lying around in the classes/ directory. Try running the clean target or cleaning the directory manually.

    * maybe your JAVA_HOME environment variable is not set. Set it, and restart Eclipse

    * sometimes verifying the classes works, but fails on the jar file

  7. #7
    Registered User
    Join Date
    May 2004
    Posts
    11

    Still in trouble

    sjbrown0
    >* maybe there are some old files lying around in the classes/ directory. Try running the clean target or cleaning the
    >directory manually.
    Yes, I do that, was the suggest of the FAQ

    >* maybe your JAVA_HOME environment variable is not set. Set it, and restart Eclipse
    It's set. I use Jbuilder9 Enterprise

    >* sometimes verifying the classes works, but fails on the jar file
    I can make the jar file with out the verify task, but on the emulator raise the error "VerifyError"

    kisember
    I'm not shure, can you take a look of this?
    This is my bootclasspath
    <property name="jdk.home" value="C:\Nokia\Devices\Nokia_S40_DP20_SDK_1_1"/>
    <property name="dest" value="${user.dir}/classes"/>
    <path id="project.class.path">
    <pathelement location="${dest}"/>
    <pathelement location="${jdk.home}/lib/classes.zip"/>
    </path>

    I try 2 way to make the verification task
    1. Comes with the ant example
    <wtkpreverify jarfile="hello.jar" jadfile="hello.jad"/>

    2. Comes with the Nokia SDK Serie 40 DP20
    <target description="Preverify classes" name="preverify">
    <exec dir="." executable="${jdk.home}/bin/preverify.exe" failonerror="true">
    <arg value="-classpath"/>
    <arg value="${javacompile_dest};${jdk.home}/lib/classes.zip"/>
    <arg value="-d"/>
    <arg value="${dest}"/>
    <arg value="${javacompile_dest}"/>
    </exec>
    </target>

    Thank you for you reply
    Regards

  8. #8
    Registered User
    Join Date
    May 2004
    Posts
    11

    New Issue

    The previus post, was sended because I can't do the package with the preverification task.

    When I change the preverify to true on wtkbuild and set to false on wtkpackage, it compiles, preverify and package.

    I test my jar on the emulator and it goes ok.

    Now the new issue.

    When I copy the jar file on the cell phone, via infrared, and try to open the file to install the application trowing an "incompatible file" exception

    Thanks for you reply

    Best regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×