Cartesian Theater
Cartesian Theater

Reputation: 1970

Android Studio Can't Find JDK Mac

I'm just trying out Android Studio. I imported a project from Eclipse, but every time I try to run it I get this error:

"Cannot run program "Library/JavaVirtualMachines?jdk1.7.0_10.jdk/Contents/Home/bin/java" (in directory "/Users/myname/Library/Caches/AndroidStudioPreview/compile-server"): error=2, No such file or directory.

I just installed the latest JDK using the JDK 7 Update 21 dmg. Is it installing the jdk in a place where Android Studio won't find it? The dmg didn't have any options for where to install the jdk other than "Install for all users of this computer," which I did.

When I was using Eclipse I had no problems with running my programs.

Furthermore, the Project Structure option was no longer available after I updated earlier today. Instead I just get the message, We will provide a UI to configure project settings later. Until then, please manually edit your build.gradle file(s.)"

I'm not sure what to do to get my programs running again. Do I need to locate the jdk files and move them? Could I tell Android Studio where the files are actually installed?

Upvotes: 5

Views: 5799

Answers (2)

coltsfan95
coltsfan95

Reputation: 75

Yes changing the JDK path will work. If that doesn't fix your problem, as it didn't for me at first, uninstall your JDK and redownload and install it. Once I reinstalled mine, it worked flawlessly.

Upvotes: 0

Cartesian Theater
Cartesian Theater

Reputation: 1970

The solution was easier than I thought: just go to File/Other Settings/Default Project Structure and click SDKs. There the JDK home path can be changed.

Upvotes: 7

Related Questions