Ant should either give a sane error msg or make sure to set the JDK_HOME variable itself by scanning java-config. |Warning: JAVA_HOME environment variable not set. | If build fails because sun.* classes could not be found | you will need to set the JAVA_HOME environment variable | to the installation directory of java. |Error: JAVA_HOME is not defined correctly. | We cannot execute java Reproducible: Always Steps to Reproduce: 1. Install blackdown jdk _and_ jre 2. Use java-config and set the default JAVA_HOME to the jre 3. emerge dev-java/ant Actual Results: It bails out with the above error msg Expected Results: Compile cleanly and set the JAVA_HOME itself _or_ make sure to give a sane error msg.
env-update && source /etc/profile should fix your issue. I'll look into giving the sane error message.
There is a thread about it here: http://forums.gentoo.org/viewtopic.php?t=143574&view=next
Fixed in 1.6.1. It just got unmasked so please emerge ant 1.6.1 :)