Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Installing JDK 7 on Mac OS X

DZone's Guide to

Installing JDK 7 on Mac OS X

· Java Zone
Free Resource

What every Java engineer should know about microservices: Reactive Microservices Architecture.  Brought to you in partnership with Lightbend.

 To get JDK 7 up,

Surgery required.  So, I headed over to:

/System/Library/Frameworks/JavaVM.framework/Versions

This is where the system jvm's are stored.  You'll notice a symbolic link for CurrentJDK.  It probably points to:

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents

You're going to want to point that to the new JDK, which java_home tells us is located in:

bone@zen:/usr/libexec$ /usr/libexec/java_home
/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home

So, the magic commands you need are:

bone@zen:/System/Library/Frameworks/JavaVM.framework/Versions$ sudo rm CurrentJDK
bone@zen:/System/Library/Frameworks/JavaVM.framework/Versions$ sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/ CurrentJDK

Then, you should be good:

bone@zen:/System/Library/Frameworks/JavaVM.framework/Versions$ java -version 
java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)

Microservices for Java, explained. Revitalize your legacy systems (and your career) with Reactive Microservices Architecture, a free O'Reilly book. Brought to you in partnership with Lightbend.

Topics:
java ,jdk ,mac osx

Published at DZone with permission of Brian O' Neill, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}