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.

4
  • I didn't know this wasn't working until I tried to add the JDK to the IDEA IDE. Commented Aug 5, 2013 at 0:47
  • I think the upgrade to Mavericks may be free now? Commented Mar 21, 2014 at 18:26
  • 3
    @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. Commented May 22, 2014 at 19:06
  • 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? Commented Feb 24, 2015 at 13:41

9 Answers 9

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

Sign up to request clarification or add additional context in comments.

10 Comments

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?
@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.
But none is bundled in the JDK I downloaded. The current java_home points to the one bundled in a JDK v6.
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?
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.
|
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...

7 Comments

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!
@avalez 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" ?
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.
I've found this post mentioning that JDK 7 may work fine as long as AWT (i.e. window apps) is not used.
@alexandroid 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.
|
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

5 Comments

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.
This 'faking the OS version temporarliy' was easier than messing around with repacking pkg files.
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 it
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...
@NiksaJakovljevic I do not have the right to temporarily change the file SystemVersion.plist. What should I do?
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.)

1 Comment

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? :-/
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!

1 Comment

This answer would be improved by not (badly) copying two existing answers.
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.

5 Comments

Do you mind if I redistribute your binary to use my application Jubler in older versions of OSX?
@Panayotis 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!)
@Panayotis - BTW, i see on your page you misspelled my name. (jubler.org/osx_sl.html)
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.
@Panayotis 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!
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

2 Comments

That says that the minimum OS version is OS X 10.7.3. You actually built it with 10.6.x?
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!
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

Comments

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.