ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy-Lambert <>
Subject AW: AW: AW: AW: two diff't JDKs
Date Tue, 28 Oct 2003 14:37:47 GMT
I have had had a first glance at the code.
I feel also that this issue is a bug, and this bug is almost certainly
affecting ant 1.6 which is not good.
Why it is not good is that ant 1.6 can only run under JDK >= 1.2 and that it
looks like you need to run ant 1.5.4 under JDK 1.1 to be able to compile JDK
1.1 source code.
Here is the routine which produces the log message which you noticed. The
javadoc worries me.
     * The implementation for this particular task.
     * <p>Defaults to the build.compiler property but can be overridden
     * via the compiler and fork attributes.</p>
     * <p>If fork has been set to true, the result will be extJavac
     * and not classic or java1.2 - no matter what the compiler
     * attribute looks like.</p>
     * @see #getCompilerVersion
     * @since Ant 1.5
    public String getCompiler() {
        String compilerImpl = getCompilerVersion();
        if (fork) {
            if (isJdkCompiler(compilerImpl)) {
                if (facade.hasBeenSet()) {
                    log("Since fork is true, ignoring compiler setting.",
                compilerImpl = "extJavac";
            } else {
                log("Since compiler setting isn't classic or modern,"
                    + "ignoring fork setting.", Project.MSG_WARN);
        return compilerImpl;
    }, the external javac adapter invokes this :
so it looks like it is not OK for javac 1.1

This might be fixed by creating a new compiler adapter for javac 1.1
external or by adding an attribute in the to tell it to
prepare a command line for javac 1.1.



-----Ursprungliche Nachricht-----
Von: Erik Price []
Gesendet: Dienstag, 28. Oktober 2003 13:27
An: Ant Users List
Betreff: Re: AW: AW: AW: two diff't JDKs

--- Antoine_Levy-Lambert <> wrote:
> Hi Erik,
> I think that you need to use both the compiler !!!and!!! the
> executable
> attributes of <javac> in order to be able to compile properly with
> javac
> 1.1.
> The problem that you are experiencing is that ant is sending command
> line
> arguments to javac 1.1 in the 1.2 format which javac 1.1 does not
> understand.
> So do <javac executable="c:/jdk1.1/bin/javac.exe" compiler="classic"
> ...>
> and it should work fine for you.
> The executable attribute tells ant where physically the compiler
> lives.
> The compiler attribute tells ant how to talk to the compiler.

Antoine, that makes a lot of sense, since I do suspect that the 1.1
compiler is not being called correctly.  However, there is a problem --
apparently if you set fork="yes", it ignores the value of the
"compiler" attribute.  When I try it, I get a log message saying so,
and the same problem occurs.

So I tried removing the "fork" attribute (even though that doesn't make
sense since we need to fork in order to use an external compiler) just
in case there might have been a problem in the documentation/log
message.  Sure enough, it appears that the
DefaultCompilerAdapter.executeExternalCompile() method never gets

This leads me to the following conclusions:

1. In order to use the 1.1 compiler, "fork" must be set to "yes" and
"compiler" must be set to "classic".
2. Setting "compiler" to "classic" is ignored if the "fork" attribute
is set to "yes".
3. Setting the fork attribute to "no" doesn't call the external
compiler (at least, it doesn't seem to call executeExternalCompile()
from DefaultCompilerAdapter, according to my experimentation with the
1.5.4 source).

It seems that this problem is a bug, and would not exist if setting
"fork" to "yes" did not cause the "compiler" attribute to be ignored.
Do you know why it is ignored?

Thanks for your help!


Copyright.  Copy right.
The right to copy.  That's all it is.
Contrary to popular belief, there's no such thing as intellectual

Do you Yahoo!?
Exclusive Video Premiere - Britney Spears

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

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

View raw message