As mentioned here in the link below https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/android#android-studio
"At this point you can add the tensorflow/examples/android directory as a new Android Studio project."
All that I did
The Error
I am trying to build an APK from the Android Studio and found this error
Error:Execution failed for task ':buildExternalAssets'. Process 'command '/usr/bin/bazel'' finished with non-zero exit value 1
Gradle Build Messages
Executing tasks: [:assembleDebug]
Configuration on demand is an incubating feature.
:preBuild UP-TO-DATE :preDebugBuild UP-TO-DATE :checkDebugManifest :prepareDebugDependencies :compileDebugAidl UP-TO-DATE :compileDebugRenderscript UP-TO-DATE :generateDebugBuildConfig UP-TO-DATE :generateDebugResValues UP-TO-DATE :generateDebugResources UP-TO-DATE :mergeDebugResources UP-TO-DATE :processDebugManifest UP-TO-DATE :processDebugResources UP-TO-DATE :generateDebugSources UP-TO-DATE :incrementalDebugJavaCompilationSafeguard UP-TO-DATE :javaPreCompileDebug :compileDebugJavaWithJavac UP-TO-DATE :compileDebugNdk UP-TO-DATE :compileDebugSources UP-TO-DATE :buildExternalAssets
Couldn't find java at '/usr/local/java/jdk1.8.0_101/bin/java'.
FAILED
FAILURE: Build failed with an exception.
Execution failed for task ':buildExternalAssets'.
Process 'command '/usr/bin/bazel'' finished with non-zero exit value 1
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 11.433 secs
Thanks to @cricket_007 for responding and clearing my concepts about jdk installation
To solve the issue above
Open "build.gradle" at [/.../.../.../tensorflow-master/tensorflow/examples/android/build.gradle], check for
"def externalModelData = '../../../bazel-tensorflow-master/external'"
Verify that def externalModelData is pointing to the correct folder name, initially it was '../../../bazel-tensorflow/external'
I had to change it to bazel-tensorflow-master, these are the folders generated by bazel, after you compile the tensorflow sources from github on your command line, using bazel, Android SDK and Android NDK tools
Also make sure that your Jdk installation is perfect.