diff options
author | David Herman <davidherman@google.com> | 2014-11-24 16:07:14 -0800 |
---|---|---|
committer | David Herman <davidherman@google.com> | 2014-11-24 16:07:14 -0800 |
commit | f7dd3d94c134d29ad37299bdb865b0a48430dfb3 (patch) | |
tree | 3188f0d41b2e8a375d10add75ddd7c7e55bd82b1 /find_java/src | |
parent | 352b4fee3b21e6208b8bd8a4d04c523781bf4c42 (diff) | |
download | sdk-f7dd3d94c134d29ad37299bdb865b0a48430dfb3.zip sdk-f7dd3d94c134d29ad37299bdb865b0a48430dfb3.tar.gz sdk-f7dd3d94c134d29ad37299bdb865b0a48430dfb3.tar.bz2 |
find_java now locates openjdk as well
Related issue:
https://code.google.com/p/android/issues/detail?id=77218
Change-Id: I08523830c813d9cdcd303780f15f49bd5edc5ac3
Diffstat (limited to 'find_java/src')
-rwxr-xr-x | find_java/src/source/find_java_lib.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/find_java/src/source/find_java_lib.cpp b/find_java/src/source/find_java_lib.cpp index 4da645c..fe50f83 100755 --- a/find_java/src/source/find_java_lib.cpp +++ b/find_java/src/source/find_java_lib.cpp @@ -554,9 +554,12 @@ bool getJavaVersion(CPath &javaPath, CString *outVersionStr, int *outVersionInt) // care about specific ordering or case-senstiviness.
// We only captures roughtly the first line in lower case.
char *j = strstr(first32, "java");
+ if (!j) {
+ j = strstr(first32, "openjdk");
+ }
char *v = strstr(first32, "version");
if ((gIsConsole || gIsDebug) && (!j || !v)) {
- fprintf(stderr, "Error: keywords 'java version' not found in '%s'\n", first32);
+ fprintf(stderr, "Error: keywords 'java|openjdk version' not found in '%s'\n", first32);
}
if (j != NULL && v != NULL) {
result = extractJavaVersion(first32, index, outVersionStr, outVersionInt);
|