Using Java in Command Line When Android Studio is Already Installed

java android

if you have android studio already installed in Your Windows Machine, you can use java and javac (for compiling and running java) without installing anything else (like JDK Environment).

here are the steps:

now open powershell / command prompt

enter java -version

now you can compile

javac <file_name>.java

and can run

java <file_name>