ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy-Lambert <>
Subject AW: compiling Java 1.1 projects [was: two diff't JDKs]
Date Wed, 29 Oct 2003 16:05:15 GMT
Hi Erik,

I did not look at this bit of code, but I am confident that generally you
can run javac with fork="true" and use the executable that you have set
as attribute of the javac task (for instance have ant run under 1.4 VM and
compile with the 1.3 compiler).

Can you try fork="true" compiler="javac1.1" executable="path/to/your/1.1exe"
this might work

I had this idea when looking at this piece of code :

    protected boolean assumeJava11() {
        return "javac1.1".equals(attributes.getCompilerVersion())
            || ("classic".equals(attributes.getCompilerVersion())
                && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1))
            || ("extJavac".equals(attributes.getCompilerVersion())
                && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1));


-----Ursprungliche Nachricht-----
Von: Erik Price []
Gesendet: Mittwoch, 29. Oktober 2003 16:43
An: Ant Users List
Betreff: Re: compiling Java 1.1 projects [was: two diff't JDKs]

--- Antoine_Levy-Lambert <> wrote:
> Hi Erik,
> you are absolutely right. If fork="no" and compiler="classic", then
> the
> compiler of the current runtime will be called with 1-1 style
> switches.
> So something must be done to the code so that the 1-1 compiler can be
> called
> with fork="true" and a current runtime java >= 1.2

I'm not sure that I understand the logic behind this:  In
Javac.compile(), the CompilerAdapterFactory returns the appropriate
type of CompilerAdapter to use for the current script, which makes
sense.  In my case, it returns a JavacExternal because I have specified
fork="true".  However, in line 78 of (in Ant 1.5.4
source code), the JavacExternal then determines the executable to use
by querying getJavacExecutable(), which is in JavacExternal's
superclass Javac.  Then, this method returns the system Javac if

So it seems that what needs to be fixed [first] is
Javac.getJavacExecutable(), unless I'm misreading this somehow.


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