Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I need Java JDK for using Android Studio?

Tags:

java

android

I'm learning Android Studio and the tutorials on youtube like:

https://www.youtube.com/watch?v=QAbQgLGKd3Y&list=PL6gx4Cwl9DGBsvRxJJOzG4r4k_zLKrnxl

say I need the Java JDK.

Yet when I went through the tutorial at the website:

https://developer.android.com/training/basics/firstapp/creating-project.html

I was able to setup and run the myfirstapp project.

Does the new AS include the SDK or will I need it for more complicated projects.
I guess I can just run through the video tutorial until I encounter a problem but I'd like to know before I have to uninstall Android Studio, install the JDK and reinstall Android Studio.

Seems a real pain.

like image 588
Mindril Avatar asked Feb 11 '17 03:02

Mindril


People also ask

Is Java JDK necessary for Android Studio?

A copy of the latest OpenJDK comes bundled with Android Studio 2.2 and higher, and this is the JDK version we recommend you use for your Android projects.

Does Android Studio automatically install JDK?

Note that installing Android Studio doesn't automatically configure the built-in JDK command line tools. This matters if you want to use the Android SDK command line tools.

What is the use of JDK in Android?

The JDK allows developers to create Java programs that can be executed and run by the JVM and JRE.

What version of JDK do I have Android Studio?

You can use cmd + ; for Mac or Ctrl + Alt + Shift + S for Windows/Linux to pull up the Project Structure dialog. In there, you can set the JDK location as well as the Android SDK location. To get your JDK location, run /usr/libexec/java_home -v 11 in terminal.


2 Answers

This is what Google says on https://developer.android.com/studio/intro/studio-config.html:

A copy of the latest OpenJDK comes bundled with Android Studio 2.2 and higher, and this is the JDK version we recommend you use for your Android projects.

So if you are using the newest version, you won't need any additional JDK. Furthermore, the official installation instructions don't include anymore any hints towards the JDK, compared to June 2016.

like image 76
SomeAndroidDeveloper Avatar answered Sep 21 '22 00:09

SomeAndroidDeveloper


Android Studio version 2.2 and higher comes with the latest OpenJDK embedded in order to have a low barrier to entry for beginners.

It is, however, recommended to have the JDK installed on your own as you are then able to update it independent of Android Studio.


If you are working with an Android API < 24, then you'll need to compile the project with Java 7 or do some extra steps to enable Java 8 features. (Note: Java 8 support is relatively new).

Android Studio 3.0 and later supports all Java 7 language features and a subset of Java 8 language features

like image 42
OneCricketeer Avatar answered Sep 19 '22 00:09

OneCricketeer