Install Java JDK7 on Mac OSX Snow Leopard 10.6.8

1. Download the latest JDK 7 from the Oracle web site.  jdk-7u21-macosx-x64.dmg

2. I ran and mounted the JDK 7 dmg file.  A volume appeared on my desktop called JDK 7 Update 21.

3. I extracted the contents of the installer using a program called Pacifist which I downloaded from to a folder I created on the desktop.  You have to first click on Open Package within Pacifist and then load the JDK 7 Update 21 / JDK 7 Update 21.pkg package.  Once you load the package, select all the contents and drag it into a folder on the desktop.

4. At this point, you'll want to navigate to the JavaVirtualMachines directory located at [hd] / System / Lbrary / Java / JavaVirtualMachines.  You'll probably see 1.6.0.jdk package already listed.  Copy this file to the desktop and rename it to 1.7.0.jdk.  Now delete the contents within the 1.7.0.jdk package.  

5. Open  the directory where you extracted the installer contents to on the desktop.  You'll see 2 folders: JDK 7 Update 21 Folder and JDK 7 Update 21 Folder-1.  

6. Navigate to JDK 7 Update 21 Folder / Contents Directory.  There is a file called Info.plist and 2 folders called Home and MacOS.  Drag these into the 1.7.0.jdk package.

7.  Now open the JDK 7 Update 21 Folder-1 / Contents directory and drag everything into the package as well.  You do not need to replace any files or folders that already exist.

8.  Now drag the modified 1.7.0.jdk package into System / Library / Java / JavaVirtualMachines directory and double click to open it.  You should see the java preferences dialog at this point which should now list Java SE 7 as an option.  Drag it to the top and close.

If you are using NetBeans and started a project in 1.6 and continuing it in 1.7, you may need to change the Source/Binary Format located under Sources in the Project Properties.  You should see a drop down that lists JDK 6.  You need to change this to JDK 7.

When you open a Netbeans project or create a new one, you should notice the 1.7 library already loaded.  I ran the following to make sure it worked correctly:
public static void main(String[] args) {
and the following displayed in the console:


Juan Carlos said...

Hey Mate. You saved my life, thanks!!

Trev said...

Thank you so much for sharing... wew thought I needed to upgrade my iMac from Snow Leopard to Mountain Lion. Yey! :)

DanubeQuants said...
This comment has been removed by the author.
DanubeQuants said...

How can I make my command line java to be the updated one? (I'm not a programmer, just want to use java7 for a simple task.)

Miguel Perez said...

I only have 1 folder JDK 7 Update 21 and it contains the folders jdk17025 and javaappletplugin the jdk17025 does have the macos home and info.plist but the javaappletplugin folder has info.plist disabled.plist enabled.plist frameworks home macos plugins and resources lpease help

Miguel Perez said...

opps its not called JDK 7 Update 21 its JDK 7 Update 25

flyin23 said...

Thanks for the detailed steps. One change in step 6 is to create Contents folder in 1.7.0.jdk package and then drag the files there. After doing this I was able to see jdk 1.7 in the java preferences panel.

Bruce Lu said...

How to open the 1.7.0.jdk package for deleting the contents? double click does not work.

Niksa Jakovljevic aka Ksha said...

The above did not work for me so I might came up with an easier way of doing this. You can check it on my blog :



Maggie said...

Thank you!!

Jon S said...

Thank you! This was an easy setup!

Isaac said...

Hi there!!!

I'm trying to follow your great tutorial, but I miss in the step 4. Have I to delete the contents using Pacifist?? I can't find the way to do that...
Thanks in advance.

Elle said...

Hi Isaac, I was having the same problem.

You do not need Pacifist to do this step, in fact I don't think you can delete content using the program.

What you do is right click the jdk file on the desktop and select 'Show package contents'.

From there you delete the items within the Contents folder.

Hope this helped :)

Isaac said...

I Elle,

Thanks a lot for your help. I was a little bit lose...
I'll do in that way :)

Thanks again!!


Abdellah said...
This comment has been removed by the author.
Abdellah said...

Step 8, when I double click the 1.70jdk, its says "cannot luanch "java Preferences". No compatible version of java 1.5+ plus available"

I did everything right ...
using mac os x 10.6.8
the update folder i get is called "JDK 7 Update 51"
that's the only difference i have

Alex Bushatz said...

FInally worked. Had to make a few changes.

Make sure to use update 25 or older. 51 did not work for me.

And make sure to add the Contents folder and move stated files to it instead of the main folder.

Other than that worked perfect.

Thank you.

Lee Grey said...

I wasted a couple of hours and a lot of bandwidth downloading multiple versions, looking for a JDK installer that contained a Folder and a Folder-1. You will not see those names until AFTER you've used Pacifist to copy the contents of the installer pkg. Before you do the copy, you'll see jdk#####.pkg and javaappletplugin.pkg.

Erica J Dohring said...

I still only see 6 as an option after going through this whole process when I open up Java 7. Sad face.

Luan Nguyen said...

Thank you very much. Worked for me with below changes
step 4. delete the Contents folder
step 6. Navigate to JDK 7 Update 21 Folder and drag the Contents folder into the 1.7.0.jdk package
step 7. open the JDK 7 Update 21 Folder-1 / Contents directory and drag everything into the Contents folder of the 1.7.0.jdk package. Select don't replace for all.

Marcus Vinícius Mendes Gonçalves said...

i have a problem, "You'll probably see 1.6.0.jdk package already listed", JavaVirtualMachines folder is empty!

Thank you so much for your help! :)

Marcus Vinícius Mendes Gonçalves said...

My installation was corrupted, i reinstalled with this link: ;)

pgflrob said...

This method no longer works. For one thing the folder JavaVirtualMachines is not in /System/Library/Java. In fact it is gone. Not sure how or why.
But I have java.

RobsiMac:~ rob$ java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04-248)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01-101, mixed mode)
RobsiMac:~ rob$ echo $JAVA_HOME

It's Snow Leopard
RobsiMac:~ rob$ sw_vers -productVersion

RobsiMac:~ rob$ ls -la /Library/Java/Home
lrwxr-xr-x 1 root admin 48 Oct 23 11:11 /Library/Java/Home -> /System/Library/Frameworks/JavaVM.framework/Home
RobsiMac:~ rob$ cd /Library/Java/Home
RobsiMac:Home rob$ ls
bin bundle include lib man
RobsiMac:Home rob$ ls -la
total 16
drwxr-xr-x 7 root wheel 238 Oct 23 11:11 .
drwxr-xr-x 10 root wheel 340 Oct 10 2013 ..
drwxr-xr-x 41 root wheel 1394 Oct 23 11:11 bin
lrwxr-xr-x 1 root wheel 3 Oct 23 11:11 bundle -> ../
lrwxr-xr-x 1 root wheel 51 Oct 23 11:11 include -> /System/Library/Frameworks/JavaVM.framework/Headers
drwxr-xr-x 41 root wheel 1394 Oct 23 11:11 lib
drwxr-xr-x 41 root wheel 1394 Oct 10 2013 man
RobsiMac:Home rob$

Where the heck is the java 6 sdk?

Sohail Akbar said...

Unlocking software tool

Karthika Shree said...

Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
PEGA Training in Chennai

SRI said...

Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.

rpa Training in Chennai

rpa Training in bangalore

rpa Training in pune

blueprism Training in Chennai

blueprism Training in bangalore

blueprism Training in pune

rpa online training

digi mark said...

Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.

automation anywhere training in chennai

automation anywhere training in bangalore

automation anywhere training in pune

automation anywhere online training

blueprism online training

rpa Training in sholinganallur

rpa Training in annanagar

shalinipriya said...

Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.

Data Science training in marathahalli
Data Science training in btm
Data Science training in rajaji nagar
Data Science training in chennai
Data Science training in kalyan nagar
Data Science training in electronic city
Data Science training in USA

simbu said...

Really very nice blog information for this one and more technical skills are improve,i like that kind of post.

java training in marathahalli | java training in btm layout

java training in jayanagar | java training in electronic city

java training in chennai | java training in USA

selenium training in chennai

Mouni yoga said...

Pleasant Tips..Thanks for Sharing….We keep up hands on approach at work and in the workplace, keeping our business pragmatic, which recommends we can help you with your tree clearing and pruning in an invaluable and fit way.
Python training in pune
AWS Training in chennai

shethal said...

This is most informative and also this post most user friendly and super navigation to all posts... Thank you so much for giving this information to me.. 
Devops Training in Chennai
Devops Training in Bangalore

param jothi said...

It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
Blueprism training in Chennai

Blueprism online training

Blue Prism Training in Pune

Amar G said...

UiPath Training in Bangalore by myTectra is one the best UiPath Training. myTectra is the market leader in providing Robotic Process Automation on UiPath
robotic process automation training in bangalore

chitra pragya said...

The site was so nice, I found out about a lot of great things. I like the way you make your blog posts. Keep up the good work and may you gain success in the long run.
angularjs-Training in chennai

angularjs Training in chennai

angularjs-Training in tambaram

angularjs-Training in sholinganallur

angularjs-Training in velachery

Vikky cmd said...

I am really happy with your blog because your article is very unique and powerful for new reader.
Click here:
selenium training in chennai
selenium training in bangalore
selenium training in Pune
selenium training in pune
Selenium Online Training

Praylin S said...

Wonderful post with great piece of information. This is really helpful.
Corporate Training in Chennai
Corporate Training Companies in Chennai
JavaScript Training in Chennai
JavaScript Course in Chennai
Embedded System Course Chennai
Embedded Training in Chennai
Corporate Training in T Nagar
Corporate Training in Tambaram

suresh said...

Thanks for your sharing

DevOps Training in Chennai

Cloud Computing Training in Chennai

IT Software Training in Chennai

Suba said...

Your article inspired me more and keep writing.

Software testing training in chennai
JAVA Training in Chennai
Hadoop Training in Chennai
Selenium Training in Chennai
German Classes in chennai
Digital Marketing Course in Chennai
Best Digital Marketing Course in Chennai