ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ed Mack <...@wrq.com>
Subject RE: Mixing compilers
Date Thu, 08 Aug 2002 19:05:29 GMT
Thanks for the info, Stefan.

When I added the executable attribute, I got:

    [javac] javac: invalid flag: -sourcepath
    [javac] use: javac
[-g][-O][-debug][-depend][-nowarn][-verbose][-classpath p
ath][-nowrite][-deprecation][-d dir][-J<runtime flag>] file.java...

I know I'm using the 1.1 compiler, now, from the usage line.  This error
occurred
using "srcdir" and "<src path=.../>"--one of which is required by javac.

My target is:

 <javac
      fork="yes"
      executable="${tools_dir}/jdk-1.1/bin/javac"
      srcdir="${preproc_dir}"
      destdir="${obj_dir}"
      bootclasspath="${tools_dir}/jdk-1.1/lib/classes.zip"
      classpath="${preproc_dir}:${1.1-jars}"
      includejavaruntime="false"
      includeantruntime="false"
...

When I went the non-forked route (using 1.4 JDK), I ended up with what looks
like
another compatibility problem, with Java2 code this time--it compiles with
1.3.

Thanks,
Ed

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org]
Sent: Wednesday, August 07, 2002 11:03 PM
To: ant-user@jakarta.apache.org
Subject: Re: Mixing compilers


On Wed, 7 Aug 2002, Ed Mack <edm@wrq.com> wrote:

> I am forking because I was under the impression that I could use a
> different JDK than was being used to run Ant this way.

And so you can, you must use the executable attribute, see the last
example in <javac>'s doc
<http://jakarta.apache.org/ant/manual/CoreTasks/javac.html>.

In your case it would be something like (I assume you are on Unix,
otherwise the executable's name may need a .exe or something):

 <javac
      fork="yes"
      srcdir="${preproc_dir}"
      destdir="${obj_dir}"
      executable="${tools_dir}/jdk-1.1/bin/javac"
      classpath="${preproc_dir}:${1.1-jars}"
 />

      includejavaruntime="false"
      includeantruntime="false"

may be needed as additional attributes, if so let us know so we can
patch the docs for hints.

Stefan

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message