ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xar <extremd...@gmail.com>
Subject How can I access the environtment variable JAVA_HOME?
Date Wed, 01 Mar 2006 12:43:24 GMT
Hello there. I am still working with JNI and build.xml, and it's working
well but i need to use the gcc compiler as an SO command (if there is
another way of using the C compiler i'll be gratefull if any of you could
tell me), and i need to specify the include dir inside the java directory. I
tried to use directile de ${JAVA_HOME} variable but, obviously it doesn't
work.  some method to access the environtment variables?

At the moment, this is the build.xml that i have:

<target name="cCode" description="The C code of the project. It will be
stored with the correspondent java class">
                <property name="dir1" value="BOI/BOIDecoder/Decode" />
                <javah outputFile="${src}/${dir1}/BPEDecode.h"
class="${dir1}/BPEDecode" classpath="${build}"/>
                <javah outputFile="${src}/${dir1}/BPEMQDecode.h"
class="${dir1}/BPEMQDecode" classpath="${build}"/>
                <javah outputFile="${src}/${dir1}/MQDecode.h"
class="${dir1}/MQDecode" classpath="${build}"/>
                <apply executable="gcc" dest="${build}/${dir1}">
                        <arg value="-Wall"/>
                        <arg value="-fpic"/>
                        <arg value="-shared"/>
                        <arg
value="-I/usr/software/jdk1.5.0_02/include/"/>                 <-- This line
i want to change and use the $JAVA_HOME instead of /usr/software/jdk1.5.0_02
                        <arg
value="-I/usr/software/jdk1.5.0_02/include/linux/"/>          <-- This line
too
                        <arg value="-o"/>
                        <targetfile/>
                        <srcfile/>
                        <fileset dir="${src}/${dir1}" includes="*.c"/>
                        <mapper type="glob" from="*.c" to="lib*.so"/>
                </apply>
        </target>

CanSomebody help me?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message