I recently upgraded to Yosemite and it's been nothing but problems related to java. First at startup of the OS (related to Adobe), and then at startup of Eclipse, it told me I needed to install Java 6. So I went and did that and things were better but then Eclipse wasn't working.
So I started poking around and it looks like Apple's install of Java is now Java 7 even though all the symlinks point to a folder named A (which is Java 7) but the symlinks are 1.4, 1.5, and 1.6. So I think eclipse was confused. So I decided to ditch Apple's Java and go get Oracle's.
So I get Oracle's and it installs to /Library/Java/JavaVirtualMachines/jdk1.7
. However, all of Apple's java links in /usr/bin point back to Apple's Java. So to fix this I found this document:
http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jdk.html
But /usr/libexec/java_home
doesn't exist anymore. So I update all the symlinks myself (not by editing the links in /usr/bin
but by updating what they point to) so now when I do a javac
it points to Oracle's JDK, as expected.
So thinking I fixed everything I then run ant
, which was working before all this mess, and I get:
Apache Ant(TM) version 1.9.2 compiled on July 8 2013
Trying the default build file: build.xml
Buildfile: /Users/rjcarr/Subversion/p/build.xml
Detected Java version: 1.7 in: /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre
Detected OS: Unknown
parsing buildfile /Users/rjcarr/Subversion/p/build.xml with URI = file:/Users/rjcarr/Subversion/p/build.xml
Project base dir set to: /Users/rjcarr/Subversion/p
Caught an exception while logging the end of the build. Exception was:
java.lang.NoClassDefFoundError: Could not initialize class sun.util.calendar.ZoneInfoFile
...
There has been an error prior to that:
java.lang.AssertionError: Platform not recognized
And this was the result whether I set $JAVA_HOME to the Oracle Java or not. What's going on?
These things happen to me every time I update OSX, but I always forget how much trouble I have. :)
UPDATE: Thanks for the help, I have some more information. I already had a couple JDK 7 from Oracle installed under /Library/Java/JavaVirtualMachines. It seems that everything in the A folder are just undercover symlinks to whatever the java_home
returns. I had installed the latest JDK 7u71 and I think that was the culprit. I prematurely deleted the older JDKs I had and went to Oracle's archive to get my u51 back, but it wouldn't install because it thought OSX.10 was too old. So I made the leap and got JDK 8 and got past my ant problem but now I have new problems, including Eclipse won't even start. Yikes! Off to deal with that I guess.