From b52e3e0e121347055a2eaa25968e5bdfeb7ace98 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 15 Aug 2022 01:00:19 +0300 Subject: [PATCH] Add check for JDK to be actually installed. macOS has dummy /usr/bin/java. --- example/android/README.md | 2 +- example/android/check-environment.sh | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/example/android/README.md b/example/android/README.md index 7c41a295d..f484d2aa9 100644 --- a/example/android/README.md +++ b/example/android/README.md @@ -1,7 +1,7 @@ # TDLib Android example This is an example of building `TDLib` for Android. -You need a Bash shell on Linux, macOS, or Windows with some common tools, a C++ compiler, cmake, JDK, PHP, and gperf pre-installed. +You need a Bash shell on Linux, macOS, or Windows with some common tools, a C++ compiler, JDK, PHP, perl, and gperf pre-installed. ## Building TDLib for Android diff --git a/example/android/check-environment.sh b/example/android/check-environment.sh index f3bdf960d..1308647b6 100755 --- a/example/android/check-environment.sh +++ b/example/android/check-environment.sh @@ -25,7 +25,7 @@ else exit 1 fi -for TOOL_NAME in gperf jar javadoc make perl php sed tar yes unzip ; do +for TOOL_NAME in gperf jar java javadoc make perl php sed tar yes unzip ; do if ! which "$TOOL_NAME" >/dev/null 2>&1 ; then echo "Error: this script requires $TOOL_NAME tool installed." exit 1 @@ -43,3 +43,8 @@ if ! perl -MExtUtils::MakeMaker -MLocale::Maketext::Simple -MPod::Usage -e '' >/ fi exit 1 fi + +if ! java --help >/dev/null 2>&1 ; then + echo "Error: Java installation is broken. Install JDK from https://www.oracle.com/java/technologies/downloads/." + exit 1 +fi