4

I'm having problems loading up an Android Studio project I started in Mountain Lion (10.8) and am now trying to run in Mavericks (10.9) but when I open a project Gradle fails with the following error:

Gradle 'SimpleTimeProject' project refresh failed:
       /Library/Java/JavaVirtualMachines/1.6.0_43-b01-447.jdk/Contents/Home/lib/security/cacerts (No such file or directory)

I've checked the path listed there, everything exists like it should - but maybe specific certs are missing from the "cacerts" folder? I've looked around and can't seem to find a solution or anyone else running into this issue so I'm not sure where to go from here to resolve it.

I've verified the $JAVA_HOME environment variable points to a valid location (/Library/Java/JavaVirtualMachines/1.6.0_43-b01-447.jdk/Contents/Home). This appears to be causing error's to crop up in files that reference the Android SDK packages (not all files that do this, just some) and no view will load in the interface builder. And, of course, I cannot run the project.

Any advice greatly appreciated.

Brandon Buck
  • 7,177
  • 2
  • 30
  • 51
  • How is Java installed? In Mavericks, I installed Java 1.6 by following http://stackoverflow.com/questions/19533528/installing-java-on-os-x-10-9-mavericks which gives me a cacerts directory in `/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/security/cacerts`, which symlinks to `/System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security/cacerts`. I installed Java 1.7 by downloading from Oracle, and that one installs in /Library the way yours does, but its cacerts is at `/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/security/cacerts`. – Scott Barta Nov 19 '13 at 17:22
  • I'm using the 1.6 JDK to actually run Android Studio; there are known compatibility problems with 1.7 on MacOS. – Scott Barta Nov 19 '13 at 17:23
  • @ScottBarta It's the Apple packaged JDK, which is what I was using in Mountain Lion. The `cacerts` directory exists exactly where Gradle reports it doesn't exist, I've manually verified this myself on my system - I can try installing a JDK but the files exist so I don't see that resolving anything. – Brandon Buck Nov 19 '13 at 21:29
  • @ScottBarta I take that last comment back, I must have been too sleepy when I tried to debug this last night but I just realized the cacerts is symlinked but the linked file no longer exists which would cause the error. I'll follow those instructions to install the JDK and I'm almost positive that will resolve the issue - thanks for the direction! – Brandon Buck Nov 19 '13 at 21:33
  • If you haven't reinstalled Java 1.6 since updating to Mavericks, then it may explain it -- I believe you're expected to reinstall the JDK after the upgrade (see the answer linked above). I'm surprised you were left with a partially-working JDK; when I upgraded it was completely gone. – Scott Barta Nov 19 '13 at 22:18
  • @ScottBarta Well, preliminary results is now I'm getting gradle version errors so that resolved that issue - I can work forward from there. Thanks Scott, do you want to make this an answer to the question? – Brandon Buck Nov 20 '13 at 15:31
  • Done, I cleaned it up a little bit. – Scott Barta Nov 20 '13 at 17:15

1 Answers1

7

The problem seems to be a bad install of Java 1.6. When you upgrade to Mavericks, you normally have to reinstall Java 1.6 as it's not bundled with the OS as it was in previous OS X releases. See Installing Java on OS X 10.9 (Mavericks) for more details.

My installation of 1.6 on Mavericks gives me a cacerts directory in /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/security/c‌​acerts, which symlinks to /System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security/cacer‌​ts.

I'm not sure why yours is under /Library/Java/JavaVirtualMachines instead, but if you're using the same installation of Java you had under Mountain Lion, maybe it didn't get properly uninstalled during the upgrade, and its link to cacerts is now broken.

Community
  • 1
  • 1
Scott Barta
  • 79,344
  • 24
  • 180
  • 163