ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Murdoch" <adammurd...@yahoo.com>
Subject RE: Problems with ant on WindowsNT
Date Sun, 08 Oct 2000 01:57:10 GMT

Hi,

What I suspect is happening here is a compounding problem caused by ant.bat
picking up java.exe from JDK 1.3 rather than from JDK 1.1.8.  The ant.bat
script just calls "java", rather than "%JAVA_HOME%\bin\java", so if your
PATH variable points to JDK1.3 before JDK1.1.8, then ant is going to be
running in a 1.3 JVM, but using the 1.1.8 compiler.  I imagine this is not a
good thing.

This would explain the 1.3 libraries in the class path, and also the
"invalid -sourceflag" error (ant decides since it's running in a 1.3 JVM,
the compiler will understand -sourcepath, but in fact the 1.1.8 compiler is
being used, and it does not understand -sourcepath).

I'm just guessing all this from a quick look at the ant 1.2 code.  But its
probably worth checking your PATH environment variable (keeping in mind that
JDK1.3 plonks down java.exe in c:\winnt, so you could be picking it up from
there), or hacking the ant.bat script to pick up the correct java.exe.


Adam


> -----Original Message-----
> From: Parker, Daniel [mailto:Daniel.Parker@schwab.com]
> Sent: Sunday, 8 October 2000 11:17 AM
> To: ant-dev@jakarta.apache.org
> Subject: Problems with ant on WindowsNT
>
>
> I've installed the binary version of ant on a Windows NT machine.  The
> accompanying ant user manual indicates Version 1.0.8 - 2000/03/04.
> I downloaded the binary version so there's a bin directory in the
> path which
> has an ant.bat file which is what I use.
> I've got the following system variables set:
>
> ANT_HOME=C:\Tools\ant\jakarta-ant
> JAVA_HOME=C:\Tools\jdk1.1.8
>
> I have a very simple build file similiar to the example in the
> documentation
>
> <project name="myproject" default="compile" basedir=".">
>   <target name="init">
>     <tstamp/>
>     ...other properties...
>   </target>
>
>   <target name="prepare" depends="init">
>     <mkdir dir="${build}" />
>     <mkdir dir="${build.classes}"/>
>   </target>
>
>   <target name="compile" depends="prepare">
>     <javac srcdir="${src}" destdir="${build.classes}"
> classpath="${classpath}" filtering="on"/>
>   </target>
> </project>
>
> If I run ant, I see the output
>
> Executing Target: compile
> Compiling 14 source files to C:\build\classes
>
> Now, there are in fact 14 java files in the srcdir and the target
> directory
> shown is correct, but nothing gets put in the target directory!
>
> Now, if I run ant in verbose mode, I see the output
>
> Setting project property: ant.java.version -> 1.3
> Setting project property: sun.boot.class.path -> C:\Program
> Files\JavaSoft\JRE\1.3\lib\rt.jar;
> C:\Program Files\JavaSoft\JRE\1.3\lib\i18n.jar;
> C:\Program Files\JavaSoft\JRE\1.3\libsunrsasign.jar;
> C:\Program Files\JavaSoft\JRE\1.3\classes
>
> But I specified jdk1.1.8!!!  The indicated 1.3 files are on my
> local drive,
> but they're not anywhere in my environment variables.
>
> If I set the build.compiler property to "classic", I get an error message
>
> javac: invalid flag: -sourcepath
>
> What's going on???
>
> Thanks,
> Daniel Parker


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Mime
View raw message