ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nico Seessle" <>
Subject Re: build.exe
Date Sat, 07 Jul 2001 15:07:57 GMT
----- Original Message -----
From: "Michael Jennings" <>
To: <>
Sent: Sunday, June 24, 2001 9:56 PM
Subject: build.exe

> A while ago I sent a message to the ant-user mailing list saying that I
> developed a win32 executable for running ANT. I posted a URL with
> a link to source code+exe but it doesn't look like it made it into
> the ANT distribution.

I had a look at it today, since there are so many problems with ant.bat on
different Windows-versions.

I have it working on my system (W2K, SP2) with JDK 1.3, JDK 1.3.1, JDK 1.4
and it does not seem to have any problems with Ant being installed in a
directory with spaces.

I had the following problems with it:
- I didn't know how to compile it (found out that you can compile it with
for example
  "bcc32 -WC -ID:\jdk13\include -ID:\jdk13\include\win32 *.cpp")
- The source looked ugly to me (I reformatted it a little bit)
- It didn't work with JDK 1.4 (there is no classic-vm in JDK 1.4) (*1)
- It didn't worked for me without passing any argument (it passed "null" to
main() instead of an empty array)

(*1) It now searches for a VM in the following way:
- Read CurrentVersion from "HKEY_LOCAL_MACHINE\JavaSoft\Java Development
- Read JavaHome from "HKEY_LOCAL_MACHINE\JavaSoft\Java Development
- Try to load ${JavaHome}\jre\bin\hotspot\jvm.dll
- If no success: Try to load ${JavaHome}\jre\bin\classes\jvm.dll
- If no success: Read "RuntimeLib" from "HKEY_LOCAL_MACHINE\JavaSoft\Java
Runtime Environment\${CurrentVersion}" and try to load that one
- If no success: Abort.

Some problems remain:
- Doesn't work with JDK 1.1 (Don't know how to start a VM?)
- You can't pass any arguments to the VM (to specify memory sizes)

You will find the modified version at (located in the directory
"src/native/win32/launcher" relative to $ANT_HOME). The build.xml will not
be useful for most of you, since it uses the "cc" and "link" tasks modified
for the free Borland C++ 5.5 Package. You can compile it using
"bcc32 -WC -ID:\jdk13\include -ID:\jdk13\include\win32 *.cpp" if you have
The free Borland package installed. antrun.exe is included for people who
would like to play with it and don't want to install the compiler.

Please be warned: I'm not a good C (or CPP) programmer, so that modified
version may do anything to your system (but I don't think so, maybe I
introduced some memory-leaks as I'm not very good at working with pointers).

Michael: you are ready to donate this source to the ASF and we can add the
ASF-Copyright header to it?

Others: Do you think it would be useful to add this (as ant.exe) to the Ant
Distribution, so we can avoid future problems with ant.bat?


View raw message