Correct jar lib for android ane

378 views Asked by At

I want to compile ane completely with ant. But there is a problem. My ane not works. I realized experimentally that a problem in jar file: if I export jar with eclipse ide, ane works correctly. But if i compile jar with ant it not works. Both jar files look very similar and I can`t find difference. JDK verion 1.7.0(upd.40) This is my ant fragment:

<property name="FLEX_HOME" value="C:/Program Files (x86)/FlexSDK/4.11.0/"/> 
<property name="fre.lib" value="${FLEX_HOME}/lib/android/FlashRuntimeExtensions.jar" />
<property name="android.lib" value="C:/Program Files (x86)/Android SDK/sdk/platforms/android-10/android.jar" />

<target name="compile.classes" description="Compile java classes">
     <javac destdir="temp/java_classes" classpath="${fre.lib}:${android.lib}" fork="true">
          <src path="${java.classes}"/>
     </javac>
</target>

<target name="compile.jar" description="Make jar lib">
     <jar destfile="temp/libs/lib.jar">
          <fileset dir="temp/java_classes">
               <include name="**/*.class"/>
          </fileset>
     </jar>
</target>

How to compile jar lib correctly? Maybe I lost java comliler parameters?

1

There are 1 answers

0
illuzor On BEST ANSWER

I found solution. I`m compiling with jdk 7. But ane not works with this version. Need to install jkd 6 and add some compiler properties:

<property name="java_rt.lib" value="C:/Program Files (x86)/Java/jdk1.6.0_45/jre/lib/rt.jar" />

<target name="compile.jar" description="Making jar lib">
    <javac 
        failonerror="true"
        destdir="temp/java_classes"
        classpath="${fre.lib}:${android.lib}"
        source="1.6" target="1.6"
        includeantruntime="false"
        bootclasspath="${java_rt.lib}">
        <src path="${java.classes}"/>
    </javac>
    <jar basedir="temp/java_classes" destfile="temp/ane/android/commExtLib.jar"/>
</target>