ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 52632] New: JAVA_HOME incorrectly defined in ant shell script for Mac OS X 10.7 (Lion)
Date Thu, 09 Feb 2012 17:12:39 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=52632

             Bug #: 52632
           Summary: JAVA_HOME incorrectly defined in ant shell script for
                    Mac OS X 10.7 (Lion)
           Product: Ant
           Version: 1.8.2
          Platform: Macintosh
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Wrapper scripts
        AssignedTo: notifications@ant.apache.org
        ReportedBy: ashirazi@codesherpas.com
    Classification: Unclassified


On Mac OS X 10.7 (Lion), running the default ant command (with no shell
ANT_HOME set) gives me:
$ ant
Error: JAVA_HOME is not defined correctly.
  We cannot execute /System/Library/Frameworks/JavaVM.framework/Home/bin/java


Below is a patch that fixes the problem. Your ant shell script correctly
calculates JAVACMD in the following line:
    JAVACMD=`which java 2> /dev/null `
But was unable to get to this point because the JAVA_HOME had been incorrectly
hard-coded for Darwin (Mac OS X).

--- /opt/local/share/java/apache-ant/bin/ant.orig    2012-02-09
12:02:30.000000000 -0500
+++ /opt/local/share/java/apache-ant/bin/ant    2012-02-09 12:02:53.000000000
-0500
@@ -83,11 +83,7 @@
 mingw=false;
 case "`uname`" in
   CYGWIN*) cygwin=true ;;
-  Darwin*) darwin=true
-           if [ -z "$JAVA_HOME" ] ; then
-             JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
-           fi
-           ;;
+  Darwin*) darwin=true ;;
   MINGW*) mingw=true ;;
 esac

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message