How to configure Java SDK when creating Android project in IntelliJ?

I am trying to start an Android project in IntelliJ by following the JetBrain instructions here , but when I start, select the project template (step # 2). Error

"Unable to create SDK

You must configure the Java SDK first. "

I do this on mac and follow the first page of instructions before the ones that were linked above. In particular:

  • I tools/android update sdk --no-ui from the terminal after downloading only the contents of the Android SDK. I mention this because it says “start SDK manager”, but I don’t see anything in what I unpacked. Running the above command downloaded and installed many versions and versions of the Android API.
  • The loaded JDK was jdk-7u17. I installed it; what is all i need to do?

The error for “setting up the Java SDK first” appears when I click the “Create ...” button in step 2. Does anyone know how I can configure my Java SDK? Is there something I missed or is missing from the JetBrain instructions?

Clicking New ... causes the error here.

EDIT: Apparently, after clicking OK, a file browser appears. This bothers me as it accepts setting my JDK location, but I want to see the Android project. My Android SDK is located in a folder named "android-sdk-macosx", but this does not bring up the Android options when it was selected. How to get to Android templates?

+6
source share
2 answers

Have you downloaded some of the Android SDK? Try running tools/android sdk (the SDK manager opens) and download one of the SDKs. Then add this to your project.

+4
source

Take a look at the IntelliJ documentation that explains how to configure the SDK.

First you need to configure the JDK (see also Configuring JDK 7 for IntelliJ on Mac ), then you can open your Android project.

+4
source

All Articles