Changeset 13932


Ignore:
Timestamp:
2007-02-20T15:28:58+13:00 (14 years ago)
Author:
shaoqun
Message:

make the testing java right

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/gs3-setup.bat

    r13618 r13932  
    4343:: Some users may set the above line manually
    4444if not "%JAVAPATH%" == "" goto testJava
     45   
     46:: If it is set, use the JAVA_HOME environment variable
     47    if not "%JAVA_HOME%" == "" goto javahome
    4548
    46     :: If it is set, use the JAVA_HOME environment variable
    47     if not "%JAVA_HOME%" == "" goto exit
     49    :: Check if Java is on the search path
     50    echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > setjava.bat
     51    call setjava.bat
     52    del setjava.bat
     53    echo %JAVAPATH%
     54    if not "%JAVAPATH%" == "" goto testJava
    4855
    49     :: Look in the registry for Java SDK installations
     56    :: Still haven't found anything, so try looking in the registry (gulp!)
    5057    type nul > jdk.reg
    5158    regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
    5259    type jdk.reg > jdk.txt
    5360    del jdk.reg
     61    type nul > jre.reg
     62    regedit /E jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
     63    type jre.reg > jre.txt
     64    del jre.reg
    5465
    55     winutil\findjava.exe jdk.txt | winutil\setvar.exe JAVAPATH > setjava.bat
     66    winutil\findjava.exe jdk.txt jre.txt | winutil\setvar.exe JAVAPATH > setjava.bat
    5667    del jdk.txt
     68    del jre.txt
    5769    call setjava.bat
    5870    del setjava.bat
    5971
    60     :: If a suitable installation was found in the registry, check it
    61     if not "%JAVAPATH%" == "" goto testJava
     72    :: If nothing was found in the registry, we're stuck
     73    if "%JAVAPATH%" == "" goto noJava
     74
     75    set JAVAPATH=%JAVAPATH%\bin
     76    goto testJava
     77
     78:javahome
     79    set JAVAPATH=%JAVA_HOME%\bin
     80
     81:testJava
     82if exist "%JAVAPATH%\java.exe" goto  exit
     83
    6284
    6385:noJava
     
    6991    goto exit
    7092
    71 :testJava
    72 set JAVA_HOME=%JAVAPATH%
     93:exit
    7394
    74 :exit
     95
     96
Note: See TracChangeset for help on using the changeset viewer.