简体   繁体   中英

IntelliJ Idea fails to create a new Android application project

I am using IntelliJ Idea 12.1.4 Community Edition in Windows 7 which contains Android Support by default.

I can import Android projects which were created using Eclipse and they are working fine in IntelliJ. But when I tried to create a new Android Project in IntelliJ it failed to do so. It is showing a dialog box

Cannot find resource directory for module [ProjectName]

Then in Android Console:

The project wasn't generated by 'android' tool.

'C:\\Windows\\system32\\java.exe' is not recognized as an internal or external command, operable program or batch file.

Invalid path

ERROR: SWT folder '' does not exist.

Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.

I have tried both answers from the following questions:
intellij IDEA - create android app failed
IntelliJ IDEA 12 - New Android Application Module wizard fails with "cannot find resource directory for module"
But both answers has failed to solve this.

Edit: Screeshots of SDKs' path in IntelliJ Idea

JDK Path:
在此输入图像描述

Android SDK Path:
在此输入图像描述

Thank you @CrazyCoder for your answer as in comment.

I added a new variable in Environment Variables called JAVA_HOME with JDK path - C:\\Program Files\\Java\\jdk1.7.0_25 as value.

Now IntelliJ Idea creating new Android Projects successfully.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM