Expected to find it in c:\program files\adobe\flex builder 3\lib\tools.jar

##ANT Error with Flex Builder 3 and Windows XP command line##
##Unable to locate tools.jar. Expected to find it in C:\Program Files\Adobe\Flex Builder 3\lib\tools.jar##
Ahhhhhhhhhhhhhhhh! Right? But never fear, I eventually found the solution and that solution may be that for which you are looking. (Don't end a sentence with a preposition at the risk of sounding like Yoda.)
tools.jar is part of a set of prepackaged libraries that come with the Java SDK. ANT uses tools.jar for things like regular expressions and other things, so ANT will compile source code with out it but many other things will just not work.
Normally when you install ANT on a windows system you have to create an environment variable JAVA_HOME in system properties. This variable has to point to your install of the JDK. For example "C:\Sun\SDK\jdk"
If that is what you have done and yes ant continues to look for the JDK in "C:\Program Files\Adobe\Flex Builder 3\" then you may have had the same problem I had. I looked at the environment variables and the JAVA_HOME path was correctly set, but then when I typed into the Window's command line "echo %JAVA_HOME%", I got "C:\Program Files\Adobe\Flex Builder 3\"
HMMM! Some unknown force is changing my Environment Variable JAVA_HOME dynamically with out me knowing.
The problem turns out to occur when I run from the start menu the "Adobe Flex SDK Command Prompt"
This runs a FlexFrameworkCmdPrompt.bat file which contains the command "@set JAVA_HOME=%CD%\jre"
To fix it I type into the command line prompt "@set JAVA_HOME=C:Sun\SDK\jdk" (or in your case where ever you have installed the JDK)
Then I vow to never run that pesky bat file again and boom, problem solved! The ANT autobuild works everytime.

comments powered by Disqus