I am trying to install SOLR and running \"ant example\" The build gets pretty far but then gives an error:
/root/apache-solr-3.2.0/solr/common-build.xml:250:
OK, I was able to solve the problem I was having. I had set JAVA_HOME, but not as a system environment variable.
Basically, ant was spawning a new process and wasn't picking up any of the shell variables I had set. So while my current shell could see $JAVA_HOME, when ant was running it could not. It was Brian Kelly's helpful comment on the question of:
What does java.home show if you run: ant -diagnostics | grep java.home
This showed the location ant was looking for java by default, and proved that my variable wasn't being picked up.
The machine I was connected to was running bash, so I had to put the lines below into .bash_profile:
JAVA_HOME=/usr/java/jdk1.6.0_18
export JAVA_HOME
After this, it ran without a hitch.
Hope this helps someone.