DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37284>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37284

           Summary: guess JDK location on Mac OS X
           Product: Tomcat 5
           Version: Unknown
          Platform: Macintosh
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: trivial
          Priority: P2
         Component: Native:Packaging
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


Under Mac OS X there is defined standard JDK location. JDK 1.5 shipped by Apple 
is always installed to 
/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home.

Simple patch checks whether this JDK exists if JAVA_HOME and JRE_HOME are unset.

===
--- ./catalina.sh.orig  2005-10-28 01:12:12.000000000 +0400
+++ ./catalina.sh       2005-10-28 01:11:38.000000000 +0400
@@ -45,9 +45,11 @@
 # OS specific support.  $var _must_ be set to either true or false.
 cygwin=false
 os400=false
+darwin=false
 case "`uname`" in
 CYGWIN*) cygwin=true;;
 OS400*) os400=true;;
+Darwin*) darwin=true;;
 esac
 
 # resolve links - $0 may be a softlink
--- ./setclasspath.sh.orig      2005-10-28 01:10:05.000000000 +0400
+++ ./setclasspath.sh   2005-10-28 01:19:52.000000000 +0400
@@ -10,9 +10,13 @@
 
 # Make sure prerequisite environment variables are set
 if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
-  echo "Neither the JAVA_HOME nor the JRE_HOME environment variable is defined"
-  echo "At least one of these environment variable is needed to run this 
program"
-  exit 1
+  if $darwin && [ -d 
"/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home" ]; then
+    export 
JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home"
+  else
+    echo "Neither the JAVA_HOME nor the JRE_HOME environment variable is 
defined"
+    echo "At least one of these environment variable is needed to run this 
program"
+    exit 1
+  fi
 fi
 if [ -z "$JAVA_HOME" -a "$1" = "debug" ]; then
   echo "JAVA_HOME should point to a JDK in order to run in debug mode."
--- ./startup.sh.orig   2005-10-28 01:10:30.000000000 +0400
+++ ./startup.sh        2005-10-28 01:11:01.000000000 +0400
@@ -7,9 +7,11 @@
 
 # Better OS/400 detection: see Bugzilla 31132
 os400=false
+darwin=false
 case "`uname`" in
 CYGWIN*) cygwin=true;;
 OS400*) os400=true;;
+Darwin*) darwin=true;;
 esac
 
 # resolve links - $0 may be a softlink
===

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to