Bug 86902

Summary: [patch] Align devel/apache-ant invocation to the java/javavmwrapper way
Product: Ports & Packages Reporter: Panagiotis Astithas <past>
Component: Individual Port(s)Assignee: Herve Quiroz <hq>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
ant.patch none

Description Panagiotis Astithas 2005-10-04 22:40:13 UTC

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.
Comment 1 Herve Quiroz freebsd_committer freebsd_triage 2005-10-05 03:24:59 UTC
Responsible Changed
From-To: freebsd-ports-bugs->hq

I'll handle this.
Comment 2 Herve Quiroz freebsd_committer freebsd_triage 2005-10-07 18:54:29 UTC
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.
Comment 3 Herve Quiroz freebsd_committer freebsd_triage 2005-10-10 15:48:38 UTC
State Changed
From-To: analyzed->closed

Patch commited. 

Changes are documented in ports/UPDATING as well. 

Thanks for your contribution!