Well ANT now works.
What did I do?
I removed it from c:\program files and 'reinstalled' it into "c:\ant"
Seems like it doesn't like non 8.3 filenames or directories.
Funnily enough I did this only because I misread the part of the manual that suggested ANT shouldn't be in non 8.3 style locations on 95/98/ME. I didn't spot the OS reference and gave it a go. I'm running Vista.
Oh well...
Thanks for your help guys.
Eclipse uses its own javac implementation internally. Therefore for most of the purpose you just need a compatible JRE. But javac task in ANT considers the JAVA_HOME or check for the local path
variable. On windows machine as temporary fix you can do:
Open a command prompt
then type
SET path=C:\Program Files\Java\jdk1.6.0_22\;%path%
hit enter
then type
<eclipsehome>\eclipse.exe
Now any process spawned from your eclipse will have your JDK version in the path variable.
for a permanent solution..
1. go to advance system setting
2. select advanced
tab
3. select environment variables
4. modify the system path
variable and JAVA_HOME (if required)
You can do the similar thing for *nix system (just check how to set environment setting on them)
Hope this will work.
UPDATE
The PROJECT classpath isn't the same as the ANT classpath. To set up an Ant classpath, navigate to window->preferences->ant->runtime
here check whether the Global Entries
points to C:\Program Files\Java\jdk1.6.0_22\lib\tools.jar
if not then add it. Normally it works in most of the cases where ant cries for javac task. if it fails then please check whether some other script is not resetting your JAVA_HOME variable and ANT global entries
setting.
If IvyDE is not using the ANT bundled with eclipse as plugin (and referring to some standard installation) or if you have defined a environment variable like ANT_HOME then copy
tools.jar
file from C:\Program Files\Java\jdk1.6.0_22\lib\
to ANT_HOME\lib
.
Also check this previous SO post ( Ant can't find Javac. No matter what I do it always claims JAVA_HOME is "C:\Program Files\Java\jre6" )
UPDATE 2
ok..
Check this page... http://ant.apache.org/ivy/ivyde/history/latest-milestone/preferences.html
Order of the classpath entries: By
default, the classpath container
entries are ordered by order of
declaration in the ivy.xml. When there
are many entries, it can be useful to
have them ordered lexically for
enhanced readability.
Is tools.jar
present in ivy.xml
? please check once.
Best Answer
(Select Standard VM, where applicable.)
(e.g.
C:\Program Files\Java\jdk1.7.0_04
).This worked in a particular scenario I encountered.