Reputation: 1571
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:
Upvotes: 7
Views: 3560
Reputation: 1571
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.
Upvotes: 6