More Trouble with Java and Apple - No Fluff Just Stuff

More Trouble with Java and Apple

Posted by: Ken Sipe on December 5, 2009

Well the latest update for Java from Apple came through recently. Destroying all in its path...
If you followed my advice in the past on getting Java 1.5 working on a Snow Leopard, then the new Apple update destroys that with the follow error for a Java 5 java -version:
Error occurred during initialization of VM
Unable to load native library: libjava.jnilib
Abort trap

I didn't track down the exact issue... however it is easy to detect that the Java update converts the symbolic links for Java 1.5 to point back to Java 6... Apparently Apple is NOT sorry for their crazy choice of ignorantly doing this in the first place. The solution is to completely go through the process out lined at OneSwarm again and re-establish the symbolic links. This will require you to delete the symbolic links that point to "CurrentJDK" for 1.4, 1.4.2, 1.5, and 1.5.0.

After edits an ls -l in the /System/Library/Frameworks/JavaVM.framework/Versions should look like:

drwxr-xr-x 15 root wheel 510 Dec 5 22:18 .
drwxr-xr-x 12 root wheel 408 Dec 5 22:15 ..
lrwxr-xr-x 1 root wheel 5 Dec 5 21:35 1.3 -> 1.3.1
drwxr-xr-x 3 root wheel 102 Jul 20 18:35 1.3.1
lrwxr-xr-x 1 root wheel 5 Dec 5 22:18 1.4 -> 1.4.2
lrwxr-xr-x 1 root wheel 14 Dec 5 22:18 1.4.2 -> 1.4.2-leopard/
drwxr-xr-x@ 9 root wheel 306 Feb 12 2009 1.4.2-leopard
lrwxr-xr-x 1 root wheel 5 Dec 5 22:01 1.5 -> 1.5.0
lrwxr-xr-x 1 root wheel 14 Dec 5 22:00 1.5.0 -> 1.5.0-leopard/
drwxr-xr-x@ 10 root wheel 340 Dec 5 21:59 1.5.0-leopard
lrwxr-xr-x 1 root wheel 5 Dec 5 21:35 1.6 -> 1.6.0
drwxr-xr-x 8 root wheel 272 Nov 8 14:35 1.6.0
drwxr-xr-x 9 root wheel 306 Dec 5 21:35 A
lrwxr-xr-x 1 root wheel 1 Dec 5 21:35 Current -> A
lrwxr-xr-x 1 root wheel 3 Dec 5 21:35 CurrentJDK -> 1.6


Happy coding!
Ken Sipe

About Ken Sipe

Ken is a distributed application engineer. Ken has worked with Fortune 500 companies to small startups in the roles of developer, designer, application architect and enterprise architect. Ken's current focus is on containers, container orchestration, high scale micro-service design and continuous delivery systems.

Ken is an international speaker on the subject of software engineering speaking at conferences such as JavaOne, JavaZone, Great Indian Developer Summit (GIDS), and The Strange Loop. He is a regular speaker with NFJS where he is best known for his architecture and security hacking talks. In 2009, Ken was honored by being awarded the JavaOne Rockstar Award at JavaOne in SF, California and the JavaZone Rockstar Award at JavaZone in Oslo, Norway as the top ranked speaker.

Why Attend the NFJS Tour?

  • » Cutting-Edge Technologies
  • » Agile Practices
  • » Peer Exchange

Current Topics:

  • Languages on the JVM: Scala, Groovy, Clojure
  • Enterprise Java
  • Core Java, Java 8
  • Agility
  • Testing: Geb, Spock, Easyb
  • REST
  • NoSQL: MongoDB, Cassandra
  • Hadoop
  • Spring 4
  • Cloud
  • Automation Tools: Gradle, Git, Jenkins, Sonar
  • HTML5, CSS3, AngularJS, jQuery, Usability
  • Mobile Apps - iPhone and Android
  • More...
Learn More »