The ant startup script that launches ant has a hardcoded default JAVA_HOME directory to that of ${JAVA_HOME}. This can be overridden by the user's setting of JAVA_HOME. However, this is not the recommended way to override the default jdk. Both javavmwrapper (a dependency of the jdk ports) and bsd.java.mk recommend the use of variables like JAVA_VERSION, JAVA_PREFERRED_PORTS, etc. One known case where the current script fails to override the default jdk, is when one has both jdk14 and jdk15 and tries to select jdk15 using JAVA_PREFERRED_PORTS. The attached patch (similar to the one in PR ports/86860) makes the default JAVA_HOME directory correspond to javavmwrapper's symlinks, in /usr/local/bin. How-To-Repeat: Install java/jdk14, java/jdk15 and apache-ant. Set JAVA_PREFERRED_PORTS to JAVA_PORT_NATIVE_BSDJAVA_JDK_1_5. Try to use ant to build a project that contains Java 1.5 constructs. Observe the compiler errors that prove jdk14 was used.
Responsible Changed From-To: freebsd-ports-bugs->hq I'll handle this.
State Changed From-To: open->analyzed I have been working on a similar patch with Greg Lewis (glewis) recently but I was waiting for the ports tree slush to end to commit it. It has indeed many other changes as well. Anyway, I have requested a repocopy for this port (see ports/86991) and I will handle this port and your submitted patch right when it is repocopied.
State Changed From-To: analyzed->closed Patch commited. Changes are documented in ports/UPDATING as well. Thanks for your contribution!