1 | rem ---------------------------------------------------------------------------
|
---|
2 | rem Set CLASSPATH and Java options
|
---|
3 | rem
|
---|
4 | rem $Id: setclasspath.bat 14725 2007-10-23 04:07:09Z qq6 $
|
---|
5 | rem ---------------------------------------------------------------------------
|
---|
6 |
|
---|
7 | rem Make sure prerequisite environment variables are set
|
---|
8 | if not "%JAVA_HOME%" == "" goto gotJdkHome
|
---|
9 | if not "%JRE_HOME%" == "" goto gotJreHome
|
---|
10 | echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
|
---|
11 | echo At least one of these environment variable is needed to run this program
|
---|
12 | goto exit
|
---|
13 |
|
---|
14 | :gotJreHome
|
---|
15 | if not exist "%JRE_HOME%\bin\java.exe" goto noJavaHome
|
---|
16 | if not exist "%JRE_HOME%\bin\javaw.exe" goto noJavaHome
|
---|
17 | if not ""%1"" == ""debug"" goto okJavaHome
|
---|
18 | echo JAVA_HOME should point to a JDK in order to run in debug mode.
|
---|
19 | goto exit
|
---|
20 |
|
---|
21 | :gotJdkHome
|
---|
22 | if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
|
---|
23 | if not exist "%JAVA_HOME%\bin\javaw.exe" goto noJavaHome
|
---|
24 | if not exist "%JAVA_HOME%\bin\jdb.exe" goto noJavaHome
|
---|
25 | if not exist "%JAVA_HOME%\bin\javac.exe" goto noJavaHome
|
---|
26 | if not "%JRE_HOME%" == "" goto okJavaHome
|
---|
27 | set JRE_HOME=%JAVA_HOME%
|
---|
28 | goto okJavaHome
|
---|
29 |
|
---|
30 | :noJavaHome
|
---|
31 | echo The JAVA_HOME environment variable is not defined correctly
|
---|
32 | echo This environment variable is needed to run this program
|
---|
33 | echo NB: JAVA_HOME should point to a JDK not a JRE
|
---|
34 | goto exit
|
---|
35 | :okJavaHome
|
---|
36 |
|
---|
37 | if not "%BASEDIR%" == "" goto gotBasedir
|
---|
38 | echo The BASEDIR environment variable is not defined
|
---|
39 | echo This environment variable is needed to run this program
|
---|
40 | goto exit
|
---|
41 | :gotBasedir
|
---|
42 | if exist "%BASEDIR%\bin\setclasspath.bat" goto okBasedir
|
---|
43 | echo The BASEDIR environment variable is not defined correctly
|
---|
44 | echo This environment variable is needed to run this program
|
---|
45 | goto exit
|
---|
46 | :okBasedir
|
---|
47 |
|
---|
48 | rem Set the default -Djava.endorsed.dirs argument
|
---|
49 | set JAVA_ENDORSED_DIRS=%BASEDIR%\common\endorsed
|
---|
50 |
|
---|
51 | rem Set standard CLASSPATH
|
---|
52 | rem Note that there are no quotes as we do not want to introduce random
|
---|
53 | rem quotes into the CLASSPATH
|
---|
54 | set CLASSPATH=%JAVA_HOME%\lib\tools.jar;%CLASSPATH%
|
---|
55 |
|
---|
56 | rem Set standard command for invoking Java.
|
---|
57 | rem Note that NT requires a window name argument when using start.
|
---|
58 | rem Also note the quoting as JAVA_HOME may contain spaces.
|
---|
59 | set _RUNJAVA="%JRE_HOME%\bin\java"
|
---|
60 | set _RUNJAVAW="%JRE_HOME%\bin\javaw"
|
---|
61 | set _RUNJDB="%JAVA_HOME%\bin\jdb"
|
---|
62 | set _RUNJAVAC="%JAVA_HOME%\bin\javac"
|
---|
63 |
|
---|
64 | goto end
|
---|
65 |
|
---|
66 | :exit
|
---|
67 | exit /b 1
|
---|
68 |
|
---|
69 | :end
|
---|