How to install java jdk 7 on Snow Leopard
Asked Answered
A

9

69

My Mac currently is running Snow Leopard (10.6.8), and I would like to develop with Java 7. I downloaded the Java 7 OS X installer from Oracle's website, started to run it. Unfortunately, I was immediately greeted with a message that said the installer is supported only on OS X Lion (10.7.3). Is there any way I can get Java 7 on my machine with Snow Leopard? I am not buying a new OS just to upgrade my Java. I googled around some, but I am not finding much. I'm hoping I can find some help here. Thanks.

Action answered 23/11, 2012 at 23:3 Comment(4)
I didn't know this wasn't working until I tried to add the JDK to the IDEA IDE.Hecto
I think the upgrade to Mavericks may be free now?Mohur
@DavidMann the cost of Mavericks isn't the issue. I'm in the same boat. I put Mavericks (clean install) on my 2009 MBP and it ran like gravy through a Capri Sun straw. And I saw no real benefit. 99% of my MBP usage is for Java/Arduino development and YouTube. It's ridiculous that we're forced to either buy another MBP or cripple our "still good" MBP just so we can run the MORE SECURE version of Java. Shame on Apple and Shame on Oracle.Ochlophobia
absolutely agree, what's the point in installing a bloated OS made to impress a girlfriend and replace the minimalist, fast, rock-solid Snow Leopard?Pettifogger
H
42

Use Pacifist from http://www.charlessoft.com/ to open and install the 'JDK 7 Update X.pkg' in the 'jdk7-7uX-macosx-x64.dmg' file you download from http://www.oracle.com/technetwork/java/javase/downloads/index.html

Helban answered 24/12, 2012 at 17:53 Comment(10)
Hi, I followed your procedure as well, but it seems Maven (3.0.4 and 3.0.5 at least) do not work. I indeed get "java.lang.AssertionError: Platform not recognized". Am I the only one facing this?Lenee
@Rolf Did you set the JAVA_HOME variable ? On my configuration I've set the following for command line arguments JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_13.jdk/Contents/Home. Also it might interest you to have a look at the following program /usr/libexec/java_home.Antony
But none is bundled in the JDK I downloaded. The current java_home points to the one bundled in a JDK v6.Lenee
So does using this method mean that the /usr/libexec/java_home program doesn't reflect the newly installed JDK7 package? I have installed JDK7 on another (newer) Mac that has OS X 10.9, and after installing the package, then /usr/libexec/java_home pointed to it. But is that not the case when installing it via Pacifist?Catechin
Thanks. Worked perfectly. To get sbt (and other terminal apps) to pick this up I did: echo 'export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home' >> ~/.profileFrancinafrancine
I had the same problem installing Java 7 for snow Leopard Mac. Installed Pacifist and installed Java package through pacifist. Then through Java Preferences.app reordered java hierarchy to have java 7 as the top priority.Formant
It works, but trying to launch a Bukkit server, it crashes after a while with a fatal JVM error.Bawbee
What about when there's Java 7 updates? Will Java tell you there's an update available or do I need to manually check? Will the installer now run or do I have to extract "JDK 7 Update X.pkg" each time?Claus
I was trying to use my MAC for Android development, it asked me for JDK 7, and then I followed the instructions above and it worked.Hyposthenia
-- Pacifist is compatible with Mac OS X 10.8 or higher.Shivers
U
24

From what I have read JDK 7 does not require 10.7+ so I simply opened the shipped .pkg installer file with PackageMaker (an Xcode tool) and removed the OS version requirement and re-built it.

You will need to copy the installer out of the .dmg file since you have to save changes.
Edit: You will need to Build to another directory as the mounted .dmg is read-only.

So far in my using this I haven't experienced any issues, even the Java preference pane is working properly.

One thing to note, you will have to reorder JDKs in Java Preferences.app to get programs to use the new JDK instead of Java 6.


I've even gone as far as to copy the Java 7 .jdk bundle into /System/Library/Java/JavaVirtualMachines/, and it seems to be function normally.

Just don't move/rename the JDK bundles while Java applications are running; not that I've done that by accident or anything...

Unabridged answered 22/12, 2012 at 2:23 Comment(7)
I followed the steps mostly successfully, beside Symbol not found: _JNFRunLoopDidStartNotification in JavaNativeFoundation. It might be that something went wrong during my mac upgrade, apparently _JNFRunLoopDidStartNotification was added in 10.6.5, and I'm on 10.6.8, but native bindings do not have that symbol, so quite risky I took JavaNativeFoundation from 10.7.3 and it works!Proconsul
@Proconsul That's good, up till this point I only knew that it worked for me. What were you doing to get the "Symbol not found" ?Unabridged
I've been starting tomcat. Though I somehow solved it, first copied the file from Lion, but applets were crashing firefox, and then installed all updates for Snow Leopard (not sure if it updated the file too), no problems since then.Proconsul
I've found this post mentioning that JDK 7 may work fine as long as AWT (i.e. window apps) is not used.Aphanite
@Aphanite Hmm, I was pretty sure I used AWT with JDK 7 at some point. I didn't see any issues at all, but hey, mileage may vary.Unabridged
How can I verify that I rebuilt correctly? I followed the recommendation and after install, it wanted me to restart my Macbook, which I did. When I open Java preferences, I do not see Java 1.7; from terminal command-line, java -version is reporting 1.6.0_65. ALSO NOTE: I recommend a backup before this action.Redeploy
@Unabridged I've not been able to use the AWT minecraft launcher with JDK 7 packaged this way.Mut
M
9

I had the same problem and was not able to google the proper way to do it. At the end I came up with solution myself and put it on my blog:

http://jksha.blogspot.se/2013/09/java-7-and-snow-leopard-osx-106.html

Marilee answered 13/9, 2013 at 14:10 Comment(5)
This doesn't work for groovy. I installed jdk 7 using this method, and got errors when running groovysh. The errors disappeared when I switched back to jdk 6.Theretofore
This 'faking the OS version temporarliy' was easier than messing around with repacking pkg files.Vin
This answer worked for me, while the other answers (using Pacifist or similar) did not...with Pacifist, while I could run java7 from the terminal, I was unable to get Eclipse or Utilities/Java\ Preferences to recognize itCaddis
This did not work for me installing the JRE on 10.6.8. It said it installed, but now my /Library/Java/JavaVirtualMachines/ dir is empty, and when I type 'java' in terminal, it says 'Unable to find a Java Runtime to invoke.' Not sure how to fix it either...Arboretum
@NiksaJakovljevic I do not have the right to temporarily change the file SystemVersion.plist. What should I do?Stewart
S
6

The answer from @reukiodo is definitely the way to go, so thanks a bunch!. However, it might need some further explanation for newbs like myself.

  1. Download the two DMG's that @reukiodo posted links to.
  2. Install Pacifist.
  3. Open the java-DMG with pacifist.
  4. In the 'Package Contents'-tab (default tab), select the 'Contents of JDK 7 Update XX.pkg' (XX being e.g. 51)
  5. Click the 'Install' button and follow the on-screen instructions.
  6. Open Java Preferences.app in yout Utilities folder and drag Java SE 7 to the top of the list of Java versions in the 'General'-tab (default tab)
  7. (OPTIONAL: Work with Eclipse: Follow the steps by Heath Borders answered to another, but similar question. NB! This is actually for OSX 10.7 Lion, but the same procedure holds, and it worked for me on 10.6.8 Snow Leopard.)
Steinbok answered 16/2, 2014 at 22:4 Comment(1)
I got to step 6 and couldnt find Java 7 when I opened Java Preferences.app's general tab.. am I missing something or is it because this is Java 7 update 60? :-/Martyrdom
I
2

There are two ways to do this.

  1. Download Pacifist from charlessoft.com and open the JDK PKG in it (and extract the application.)
  2. Open the PKG in PackageMaker (a tool for developers) and remove the requirement of 10.7.3.

Good luck!

Ingress answered 16/6, 2013 at 5:55 Comment(1)
This answer would be improved by not (badly) copying two existing answers.Delozier
M
2

I was able to compile openJDK 7 for snow leopard (works entirely, AWT included), from some patches at this project:
https://github.com/hgomez/obuildfactory/

If you want my binaries for a little bit of an easier time, here they are:
https://bintray.com/wyatt8740/generic/openjdk7-sdk-osx-10.6/20140622/view

The tarball is about 57 megabytes.

Extract it under /Library/Java/JavaVirtualMachines/. The JDK will be in a directory called jdk1.7.0.jdk. Set your JAVA_HOME environment variable to /Library/Java/JavaVirtualMachines/jdk1.7.0.jdk/Contents/Home, and from then put the command for setting JAVA_HOME in your ~/.profile to make it more permanent. Log out and in for it to take full effect. The only thing missing so far is a JDK 7 browser plugin.

You can also use the "Java preferences' app (can be found in spotlight search) to set it to the default when accessed via GUI as well.

Unfortunately, I don't have access to OS X at the moment to try to make java 1.8 work, so 1.7 is probably the end of the road for 10.6.

Mut answered 29/7, 2015 at 4:2 Comment(5)
Do you mind if I redistribute your binary to use my application Jubler in older versions of OSX?Isochronous
@Isochronous Go ahead! Out of curiosity, how many people? (No matter how many, the answer is still "go ahead, no problem" - I'm just curious how many people I've helped!)Mut
@Isochronous - BTW, i see on your page you misspelled my name. (jubler.org/osx_sl.html)Mut
Oh I am sorry, fixed! I don't know yet, just uploaded it. But I know that there are a lot of people who have old hardware that is not upgradable (thanks Apple). Up to now I had to create two releases of the software but now I can create only one.Isochronous
@Isochronous Tell me about it. I've got a 2006 intel 64-bit imac that can't go over 10.7 and keep graphics acceleration. It now runs Debian linux (dual booting with OS X 10.6 since I can't buy 10.7 anymore). Also a Powerbook G4 (which also runs Debian). Apple's the king of obsolete hardware. Thanks!Mut
K
1

You can build your own one. I did this before. It was easy. And it's as official as you can probably get:

https://wikis.oracle.com/display/OpenJDK/Mac+OS+X+Port

Kenward answered 23/11, 2012 at 23:14 Comment(2)
That says that the minimum OS version is OS X 10.7.3. You actually built it with 10.6.x?Action
Probably I built it with 10.7.x. Probably. But they say "...It should continue to run on 10.6.8 + Java for Mac OS X 10.6 Update 6 but that is not guaranteed..." Just try it!Kenward
S
1

I have changed the version in the /System/Library/CoreServices/SystemVersion.plist based on this video tutorial http://www.youtube.com/watch?v=eFi-H-7-PD4

Systematize answered 2/1, 2014 at 21:49 Comment(0)
E
0

What you want is not impossible but for sure NOT recommended but... once you are sure that this is what you want, here is an easy way to install Java (or any software for OS related matters): - navigate to you MainHD/System/Library/CoreServices/SystemVersion.plist - backup this file !! - open it in Text editor and alter the product version:

    <key>ProductUserVisibleVersion</key>
<string>10.6.8</string>
<key>ProductVersion</key>
<string>10.6.8</string>

according to you needs.

Warning: A samurai take 7 breaths before taken any decision.

Edea answered 27/3, 2017 at 14:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.