1 | @echo off |
---|
2 | rem Licensed to the Apache Software Foundation (ASF) under one or more |
---|
3 | rem contributor license agreements. See the NOTICE file distributed with |
---|
4 | rem this work for additional information regarding copyright ownership. |
---|
5 | rem The ASF licenses this file to You under the Apache License, Version 2.0 |
---|
6 | rem (the "License"); you may not use this file except in compliance with |
---|
7 | rem the License. You may obtain a copy of the License at |
---|
8 | rem |
---|
9 | rem http://www.apache.org/licenses/LICENSE-2.0 |
---|
10 | rem |
---|
11 | rem Unless required by applicable law or agreed to in writing, software |
---|
12 | rem distributed under the License is distributed on an "AS IS" BASIS, |
---|
13 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
14 | rem See the License for the specific language governing permissions and |
---|
15 | rem limitations under the License. |
---|
16 | |
---|
17 | rem --------------------------------------------------------------------------- |
---|
18 | rem Set CLASSPATH and Java options |
---|
19 | rem |
---|
20 | rem $Id: setclasspath.bat 562770 2007-08-04 22:13:58Z markt $ |
---|
21 | rem --------------------------------------------------------------------------- |
---|
22 | |
---|
23 | rem Make sure prerequisite environment variables are set |
---|
24 | if not "%JAVA_HOME%" == "" goto gotJdkHome |
---|
25 | if not "%JRE_HOME%" == "" goto gotJreHome |
---|
26 | echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined |
---|
27 | echo At least one of these environment variable is needed to run this program |
---|
28 | goto exit |
---|
29 | |
---|
30 | :gotJreHome |
---|
31 | if not exist "%JRE_HOME%\bin\java.exe" goto noJavaHome |
---|
32 | if not exist "%JRE_HOME%\bin\javaw.exe" goto noJavaHome |
---|
33 | if not ""%1"" == ""debug"" goto okJavaHome |
---|
34 | echo JAVA_HOME should point to a JDK in order to run in debug mode. |
---|
35 | goto exit |
---|
36 | |
---|
37 | :gotJdkHome |
---|
38 | if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome |
---|
39 | if not exist "%JAVA_HOME%\bin\javaw.exe" goto noJavaHome |
---|
40 | if not exist "%JAVA_HOME%\bin\jdb.exe" goto noJavaHome |
---|
41 | if not exist "%JAVA_HOME%\bin\javac.exe" goto noJavaHome |
---|
42 | if not "%JRE_HOME%" == "" goto okJavaHome |
---|
43 | set JRE_HOME=%JAVA_HOME% |
---|
44 | goto okJavaHome |
---|
45 | |
---|
46 | :noJavaHome |
---|
47 | echo The JAVA_HOME environment variable is not defined correctly |
---|
48 | echo This environment variable is needed to run this program |
---|
49 | echo NB: JAVA_HOME should point to a JDK not a JRE |
---|
50 | goto exit |
---|
51 | :okJavaHome |
---|
52 | |
---|
53 | if not "%BASEDIR%" == "" goto gotBasedir |
---|
54 | echo The BASEDIR environment variable is not defined |
---|
55 | echo This environment variable is needed to run this program |
---|
56 | goto exit |
---|
57 | :gotBasedir |
---|
58 | if exist "%BASEDIR%\bin\setclasspath.bat" goto okBasedir |
---|
59 | echo The BASEDIR environment variable is not defined correctly |
---|
60 | echo This environment variable is needed to run this program |
---|
61 | goto exit |
---|
62 | :okBasedir |
---|
63 | |
---|
64 | rem Set the default -Djava.endorsed.dirs argument |
---|
65 | set JAVA_ENDORSED_DIRS=%BASEDIR%\endorsed |
---|
66 | |
---|
67 | rem Set standard CLASSPATH |
---|
68 | rem Note that there are no quotes as we do not want to introduce random |
---|
69 | rem quotes into the CLASSPATH |
---|
70 | if not exist "%JAVA_HOME%\lib\tools.jar" goto noJavac |
---|
71 | set CLASSPATH=%JAVA_HOME%\lib\tools.jar |
---|
72 | :noJavac |
---|
73 | |
---|
74 | rem Set standard command for invoking Java. |
---|
75 | rem Note that NT requires a window name argument when using start. |
---|
76 | rem Also note the quoting as JAVA_HOME may contain spaces. |
---|
77 | set _RUNJAVA="%JRE_HOME%\bin\java" |
---|
78 | set _RUNJAVAW="%JRE_HOME%\bin\javaw" |
---|
79 | set _RUNJDB="%JAVA_HOME%\bin\jdb" |
---|
80 | set _RUNJAVAC="%JAVA_HOME%\bin\javac" |
---|
81 | |
---|
82 | goto end |
---|
83 | |
---|
84 | :exit |
---|
85 | exit /b 1 |
---|
86 | |
---|
87 | :end |
---|