ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject Re: Problem making a build.xml using javah
Date Thu, 09 Feb 2006 10:54:07 GMT
Xar wrote:

> 2006/2/1, Xar <>:
>> Hello.
>> I am starting a project that combines both java and C code and I need it
>> to be compiled through ant (because the main aplicattion uses it).
>> I readed the webpage and what's my surprise to see that only version 1.4supports
jni (it's that true? higher versions doesn't support jni?)
>> Well, i tried to download version 1.4 and again I was surprised when I saw
>> that its de 1.6.2 (or it promtps it when i do ant -version):
>>     /usr/software/jakarta-ant-1.4/bin/ant -version
>>     Apache Ant version 1.6.2 compiled on January 3 2006

What's happening there is that the ant shell file is probably handing 
off to another version, whatever is in ANT_HOME or something jpackage 
installed. ant -diagnostics files more info.

1. Ant1.6 supports javah; please point out the URL where it said "1.4 
only" and we'll fix it to "1.4 or later"
2. you do need ant-optional.jar with the javah task in it.

>>     /home/xar/Proyecto/temp/build.xml:4: Could not create task or type of
>> type: javah.
>>     Ant could not find the task or a class this task relies upon.
>> The build.xml couldn't be shorter:
>>     <project name="BOI" default="compile" basedir=".">
>>             <target name="compile">
>>                     <javac srcdir="." destdir="." nowarn="off" />
>>                     <javah destdir="." class="HelloWorld" />
>>             </target>
>>     </project>

run in -v mode for better diagnostics, perhaps.

Like Thomas says, once you start trying to compile the c++ code, you'll 
need the relevant tasks from


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message