Changeset 14725


Ignore:
Timestamp:
2007-10-23T17:07:09+13:00 (15 years ago)
Author:
qq6
Message:

looking for the JRE home first then the JAVA_home when running tomcat

Location:
greenstone3/trunk/resources/tomcat
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/resources/tomcat/setclasspath.bat

    r11288 r14725  
    66
    77rem Make sure prerequisite environment variables are set
    8 if not "%JAVA_HOME%" == "" goto gotJavaHome
    9 echo The JAVA_HOME environment variable is not defined
    10 echo This environment variable is needed to run this program
     8if not "%JAVA_HOME%" == "" goto gotJdkHome
     9if not "%JRE_HOME%" == "" goto gotJreHome
     10echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
     11echo At least one of these environment variable is needed to run this program
    1112goto exit
    12 :gotJavaHome
     13
     14:gotJreHome
     15if not exist "%JRE_HOME%\bin\java.exe" goto noJavaHome
     16if not exist "%JRE_HOME%\bin\javaw.exe" goto noJavaHome
     17if not ""%1"" == ""debug"" goto okJavaHome
     18echo JAVA_HOME should point to a JDK in order to run in debug mode.
     19goto exit
     20
     21:gotJdkHome
    1322if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
    1423if not exist "%JAVA_HOME%\bin\javaw.exe" goto noJavaHome
    1524if not exist "%JAVA_HOME%\bin\jdb.exe" goto noJavaHome
    1625if not exist "%JAVA_HOME%\bin\javac.exe" goto noJavaHome
     26if not "%JRE_HOME%" == "" goto okJavaHome
     27set JRE_HOME=%JAVA_HOME%
    1728goto okJavaHome
     29
    1830:noJavaHome
    1931echo The JAVA_HOME environment variable is not defined correctly
     
    4557rem Note that NT requires a window name argument when using start.
    4658rem Also note the quoting as JAVA_HOME may contain spaces.
    47 set _RUNJAVA="%JAVA_HOME%\bin\java"
    48 set _RUNJAVAW="%JAVA_HOME%\bin\javaw"
     59set _RUNJAVA="%JRE_HOME%\bin\java"
     60set _RUNJAVAW="%JRE_HOME%\bin\javaw"
    4961set _RUNJDB="%JAVA_HOME%\bin\jdb"
    5062set _RUNJAVAC="%JAVA_HOME%\bin\javac"
  • greenstone3/trunk/resources/tomcat/setclasspath.sh

    r11288 r14725  
    77
    88# First clear out the user classpath
    9 # gs3 - we need to set classpath
    109CLASSPATH=$CLASSPATH
    1110
    1211# Make sure prerequisite environment variables are set
    1312if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
    14   echo "Neither the JAVA_HOME nor the JRE_HOME environment variable is defined"
    15   echo "At least one of these environment variable is needed to run this program"
    16   exit 1
     13  # Bugzilla 37284
     14  if $darwin && [ -d "/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home" ]; then
     15    export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home"
     16  else
     17    echo "Neither the JAVA_HOME nor the JRE_HOME environment variable is defined"
     18    echo "At least one of these environment variable is needed to run this program"
     19    exit 1
     20  fi
    1721fi
    1822if [ -z "$JAVA_HOME" -a "$1" = "debug" ]; then
Note: See TracChangeset for help on using the changeset viewer.