You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by jf...@apache.org on 2007/10/27 10:19:25 UTC

svn commit: r589060 - in /tomcat/tc6.0.x/trunk: STATUS bin/setclasspath.sh webapps/docs/changelog.xml

Author: jfclere
Date: Sat Oct 27 01:19:24 2007
New Revision: 589060

URL: http://svn.apache.org/viewvc?rev=589060&view=rev
Log:
Commit the accept proposal to improve JAVA_HOME detection.

Modified:
    tomcat/tc6.0.x/trunk/STATUS
    tomcat/tc6.0.x/trunk/bin/setclasspath.sh
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/STATUS
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS?rev=589060&r1=589059&r2=589060&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS (original)
+++ tomcat/tc6.0.x/trunk/STATUS Sat Oct 27 01:19:24 2007
@@ -26,11 +26,6 @@
   [ New proposals should be added at the end of the list ]
 
 
-* Guess java location from the PATH environment. http://people.apache.org/~jfclere/patches/setclasspath.sh.patch
-  And improve fix for 37284.
-  +1: fhanik, remm, funkman, pero, jim
-  -1:
-
 * Harmonize with HTTP java.io code. Otherwise the socket is not closed. http://people.apache.org/~jfclere/patches/AjpPro.patch
   +1: jfclere, fhanik, remm, pero, jim
   -1:

Modified: tomcat/tc6.0.x/trunk/bin/setclasspath.sh
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/bin/setclasspath.sh?rev=589060&r1=589059&r2=589060&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/bin/setclasspath.sh (original)
+++ tomcat/tc6.0.x/trunk/bin/setclasspath.sh Sat Oct 27 01:19:24 2007
@@ -26,10 +26,25 @@
 
 # Make sure prerequisite environment variables are set
 if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
-  # Bugzilla 37284
-  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"
+  # Bugzilla 37284 (reviewed).
+  if $darwin; then
+    if [ -d "/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home" ]; then
+      export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home"
+    fi
   else
+    JAVA_PATH=`which java 2>/dev/null`
+    if [ "x$JAVA_PATH" != "x" ]; then
+      JAVA_PATH=`dirname $JAVA_PATH 2>/dev/null`
+      JRE_HOME=`dirname $JAVA_PATH 2>/dev/null`
+    fi
+    if [ "x$JRE_HOME" = "x" ]; then
+      # XXX: Should we try other locations?
+      if [ -x /usr/bin/java ]; then
+        JRE_HOME=/usr
+      fi
+    fi
+  fi
+  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

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=589060&r1=589059&r2=589060&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Sat Oct 27 01:19:24 2007
@@ -46,6 +46,7 @@
   </subsection>
   <subsection name="Catalina">
     <changelog>
+      <update>Guess java location from the PATH environment and improve fix for 37284</update>
       <update>Add NIO connector to server.xml parsing warning, remove Connector as exception case</update>
       <fix><bug>43653</bug>Fix SSL buffer mixup when response is unable to write more than socket buffer can handle</fix>
       <fix><bug>43643</bug>If connector doesn't support external executor, display warning</fix>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org