Previously, you needed to install the JDK; hence the video telling how to do it. Recent versions include a built-in JDK. Please note that Android Studio has evolved rapidly, and tutorials are quickly becoming obsolete.
Please note that installing Android Studio does not automatically configure the built-in JDK command-line tools. This is important if you want to use the Android SDK command line tools. To fix this, find the bin directory in the Android Studio installation, which contains the java command (a native command that actually runs the Java virtual machine), and add it to your path. (Another thing that may change, so I will not add specific directories to this answer.) This file is java.exe on Windows; on any other platform, it is called java and has permission to execute.
(You also need to add directories containing the SDK tools themselves.)
There are actually two such directories because the JDK, like all Java applications, contains the Java Runtime Environment (JRE). If you just want to run the SDK tools, it doesn't matter which bin directory you choose. But if you want to compile and run Java code outside of Android Studio, then you need to use the bin containing the javac command, among other important JDK development tools.
Or you can simply install the latest JDK. There is no real reason not to do this.
source share