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