Raphael | a418de5 | 2012-01-26 19:15:43 -0800 | [diff] [blame^] | 1 | @echo off
|
| 2 | rem Copyright (C) 2007 The Android Open Source Project
|
| 3 | rem
|
| 4 | rem Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 | rem you may not use this file except in compliance with the License.
|
| 6 | rem You may obtain a copy of the License at
|
| 7 | rem
|
| 8 | rem http://www.apache.org/licenses/LICENSE-2.0
|
| 9 | rem
|
| 10 | rem Unless required by applicable law or agreed to in writing, software
|
| 11 | rem distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 | rem See the License for the specific language governing permissions and
|
| 14 | rem limitations under the License.
|
| 15 |
|
| 16 | rem This script is called by the other batch files to find a suitable Java.exe
|
| 17 | rem to use. The script changes the "java_exe" env variable. The variable
|
| 18 | rem is left unset if Java.exe was not found.
|
| 19 |
|
| 20 | rem Useful links:
|
| 21 | rem Command-line reference:
|
| 22 | rem http://technet.microsoft.com/en-us/library/bb490890.aspx
|
| 23 |
|
| 24 | rem Check we have a valid Java.exe in the path. The return code will
|
| 25 | rem be 0 if the command worked or 1 if the exec failed (program not found).
|
| 26 | for /f %%a in ('%~dps0\find_java.exe -s') do set java_exe=%%a
|
| 27 | if not defined java_exe goto :CheckFailed
|
| 28 |
|
| 29 | :SearchJavaW
|
| 30 | rem Check if we can find a javaw.exe at the same location than java.exe.
|
| 31 | rem If that doesn't work, just fall back on the java.exe we just found.
|
| 32 | for /f %%a in ('%~dps0\find_java.exe -s -w') do set javaw_exe=%%a
|
| 33 | if not exist %javaw_exe% set javaw_exe=%java_exe%
|
| 34 | goto :EOF
|
| 35 |
|
| 36 |
|
| 37 | :CheckFailed
|
| 38 | echo.
|
| 39 | echo ERROR: No suitable Java found. In order to properly use the Android Developer
|
| 40 | echo Tools, you need a suitable version of Java JDK installed on your system.
|
| 41 | echo We recommend that you install the JDK version of JavaSE, available here:
|
| 42 | echo http://www.oracle.com/technetwork/java/javase/downloads
|
| 43 | echo.
|
| 44 | echo You can find the complete Android SDK requirements here:
|
| 45 | echo http://developer.android.com/sdk/requirements.html
|
| 46 | echo.
|
| 47 | goto :EOF
|