Resolved Apple Java 6 for 10.11

TheralSadurns

macrumors 6502a
Original poster
Jul 8, 2010
705
958
Did anyone figure out a way how to install Apple's Java 6 on a machine running 10.11?

I keep getting this error:
"This application requires the legacy Java SE 6 runtime which is unavailable for this version of OS X."

I have Java 8 JDK Update 45 installed on my computer.
See Terminal java -version:
"
java version "1.8.0_45"

Java(TM) SE Runtime Environment (build 1.8.0_45-b14)

Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)"



Trying to install Java for OS X 2014-001 which is the latest release of Apple's Java (that I know of at least) I get this error:
"Java for OS X 2014-001 can't be installed on this disk. A never version of this package is already installed."
Screen Shot 2015-06-09 at 07.50.40.png



Does anyone have an idea?


Update:

Solution:
https://oliverdowling.com.au/2014/03/28/java-se-8-on-mac-os-x/
 
Last edited:

mcmul

macrumors 6502
Dec 14, 2009
341
12

DFZD

macrumors 6502
Apr 6, 2012
251
47
Is your Mac specifically for development purposes or do you use it for personal use as well? I tend to put development boxes into individual VMs to separate any nastiness or surprises from my main system.
I've a couple of other macs so that's not an issue. But it's a real PITA that we'll have to wait the mighty oracle to update JRE to have this sorted. It could take weeks.
 

maflynn

Moderator
Staff member
May 3, 2009
66,689
33,576
Boston
Is your Mac specifically for development purposes or do you use it for personal use as well? I tend to put development boxes into individual VMs to separate any nastiness or surprises from my main system.
Its good to know that Java is having issues, because I need java on my machine and losing the ability will cause issues. I'm still rocking with Yosemite, so its good to be safe then sorry.
 

DFZD

macrumors 6502
Apr 6, 2012
251
47
Its good to know that Java is having issues, because I need java on my machine and losing the ability will cause issues. I'm still rocking with Yosemite, so its good to be safe then sorry.
El Capitan is having issues with java, would be a huge understatement, considering that there's no java command line tools for the latest OSX.
 

Superhai

macrumors 6502
Apr 21, 2010
457
360
Java 6 is deprecated, the release notes states that (always suggested readings before installing a beta).
 

nesl247

macrumors member
Jun 14, 2008
84
31
Florida
Java 6 is deprecated, the release notes states that (always suggested readings before installing a beta).
OS X v10.11 is the last major release of OS X that will support the previously deprecated Java 6 runtime and tools provided by Apple. Applications or features that depend upon Java 6 may not function properly or will not launch when Java 6 is removed. Developers should move to a newer version of Java as provided by Oracle. For more info on Java from Oracle: http://www.oracle.com/technetwork/java/javase/overview/
Just to give the exact text from the release notes. Java 6 for 10.11 probably hasn't been built yet.
 
  • Like
Reactions: DFZD

DFZD

macrumors 6502
Apr 6, 2012
251
47
Release notes also state that 10.11 is the last major version to support it. So I think it's oracle's turn to release an update.
 

nesl247

macrumors member
Jun 14, 2008
84
31
Florida
Release notes also state that 10.11 is the last major version to support it. So I think it's oracle's turn to release an update.
Oracle won't be building it, Apple will. Java 6 is maintained by Apple for OS X. The Oracle versions started when Apple stopped maintaining it.

Apple probably has to recompile it for 10.11, and do some testing. For the first developer preview, it probably wasn't a huge concern to make sure it was done beforehand.
 

DFZD

macrumors 6502
Apr 6, 2012
251
47
Oracle won't be building it, Apple will. Java 6 is maintained by Apple for OS X. The Oracle versions started when Apple stopped maintaining it.

Apple probably has to recompile it for 10.11, and do some testing. For the first developer preview, it probably wasn't a huge concern to make sure it was done beforehand.
Any idea on when we can expect Apple to release an update? I think waiting for the Public Beta would be too stupid.
 

nesl247

macrumors member
Jun 14, 2008
84
31
Florida
Any idea on when we can expect Apple to release an update? I think waiting for the Public Beta would be too stupid.
I don't work for Apple, so I have no idea. I would imagine within the next week. I don't recall if it was immediately available for previous DP1 releases. I seem to remember having to wait a few days.
 

dotNes

macrumors newbie
Jun 10, 2015
4
0
Belgium
I have the solution. Finally!

It's actually Oracle's fault because heir installer does NOT configure Java 7, 8, or the pre-release 9 correctly.

On the internet you find a lot of people talking a lot of bull about this or similar issues. But here I finally found:
a) a good explanation of he issue
b) an easy solution

https://oliverdowling.com.au/2014/03/28/java-se-8-on-mac-os-x/

This doesn't seem to work on my fresh 10.11 build. I have Java SE 1.80.45 installed but my Adobe Flash Builder still is searching for the legacy 1.6 version. I couldn't add the 2 folders proposed in the Jan 2015 update as well because of no permissions. How can I grant myself permissions to add these folders?
 

dotNes

macrumors newbie
Jun 10, 2015
4
0
Belgium
Thanks for that w0lf. I did manage to add these folders with your solution and I'm a little step closer to opening Flash Builder (4.6) on 10.11. However, I now get a message: Failed to create Java Virtual Machine. Any suggestions?
 

TheralSadurns

macrumors 6502a
Original poster
Jul 8, 2010
705
958
Thanks for that w0lf. I did manage to add these folders with your solution and I'm a little step closer to opening Flash Builder (4.6) on 10.11. However, I now get a message: Failed to create Java Virtual Machine. Any suggestions?
The "Failed to create Virtual Machine" message generally appears when you did NOT create the alias to the library file as per the manual.
At least for me it was like that.
Also bear in mind that you have to change the terminal commands listed there to match your java version!
 

macman191

macrumors newbie
Jun 10, 2015
1
0
Following the steps verbatim at https://oliverdowling.com.au/2014/03/28/java-se-8-on-mac-os-x/ including the Jan 2015 update worked perfectly for me. I was trying to run Charles.app on OS X 10.11 and had same issues as OP. Of course I am using jdk1.8.0_45 (instead of jdk1.8.0_40 as referenced in the article) so had to change the paths. And yes, needed w0lf's comment above to be able to do the steps in Jan 2015 update.
Thanks you all!
 

oliverdowling

macrumors newbie
Jun 10, 2015
3
4
Australia
Hi guys, I noticed I was getting a lot of traffic, so I updated my post for the latest version of Java, and added a note for El Capitan's Rootless mode down the bottom.

Code:
sudo nvram boot-args="rootless=0";sleep;sudo reboot
I think it would be better to recommend disabling Rootless mode and to restart manually. Some users might not realise that the above command will restart their computer and might be in the middle of something.

Code:
sudo nvram boot-args="rootless=0"
To enable Rootless mode again you can use

Code:
sudo nvram -d boot-args
 

TheralSadurns

macrumors 6502a
Original poster
Jul 8, 2010
705
958
Hi guys, I noticed I was getting a lot of traffic, so I updated my post for the latest version of Java, and added a note for El Capitan's Rootless mode down the bottom.



I think it would be better to recommend disabling Rootless mode and to restart manually. Some users might not realise that the above command will restart their computer and might be in the middle of something.

Code:
sudo nvram boot-args="rootless=0"
To enable Rootless mode again you can use

Code:
sudo nvram -d boot-args
Now that you are here personally...

let me thank you! And this is a big thanks indeed!

All over the Internet people are talking about this Java on OS X issue in various ways... but nobody ever really got to the bottom of it, explained what is really going on, AND has an easy to understand and viable solution!

You my dear friend are a freakin' (digital) lifesaver! And I applaud you for sharing your knowledge with the world! Much appreciated!
 
  • Like
Reactions: oliverdowling

w0lf

macrumors 65816
Feb 16, 2013
1,233
75
USA
I think it would be better to recommend disabling Rootless mode and to restart manually. Some users might not realise that the above command will restart their computer and might be in the middle of something.
You're right but I bet there's most likely way more people who would complain it doesn't work because they didn't reboot.

Code:
ba=$(nvram boot-args | sed -E "s/boot-args|rootless=.//g");
sudo nvram boot-args="rootless=0$(if [[ $ba = *[!\ ]* ]];then printf " ";echo ${ba[*]};fi)";
osascript -e 'tell app "loginwindow" to «event aevtrrst»'
And likewise completely removing boot-args is probably not recommended either because that removes all boot-args a user has set and not just rootless.

Code:
ba=$(nvram boot-args | sed -E "s/boot-args|rootless=0//g");
sudo nvram boot-args="$(echo $ba)"
These probably aren't a perfect solution either.
 
Last edited:
  • Like
Reactions: oliverdowling

dotNes

macrumors newbie
Jun 10, 2015
4
0
Belgium
Followed the guide multiple times without any luck. I can confirm jdk 1.8.0_45 is correctly installed but eclipse is still spitting out this error:
Code:
JavaVM: Failed to load JVM: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bundle/Libraries/libserver.dylib
JavaVM FATAL: Failed to load the jvm library.
Strange thing is, the symlink is in place but still not being able to load the library. Restarting didn’t solve my problem either. I then tried placing a reference to libserver.dylib directly in Flash Builder's Info.plist file but this returned following error:
Code:
dlopen(/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/server/libjvm.dylib, 2): no suitable image found. Did find:
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/server/libjvm.dylib: no matching architecture in universal wrapper
Hope you guys can help me with this. Thanks in advance!
 

toonetown

macrumors newbie
Nov 29, 2012
7
2
I was actually able to get java6 installed (and it seems to work) by doing the following:
  1. Disable rootless (boot to recovery partition, choose Utilities | Security Configuration and turn it off)
  2. Install homebrew and homebrew cask (http://caskroom.io)
  3. Install the homebrew cask versions tap (brew tap caskroom/versions)
  4. Edit the java6 cask (brew cask edit java6) and save it
    • Remove the line that says it requires <= yosemite
  5. Install the java6 cask (brew cask install java6)
    • It will ask for your sudo password and then it will install
After doing that, I re-enabled rootless and things seem to be working just fine (I also, however, have java7 and java8 installed via the homebrew cask methods...you don't need to disable rootless or modify the casks to install those two versions).
 

dotNes

macrumors newbie
Jun 10, 2015
4
0
Belgium
Finally managed to get Java SE 6 installed on El Capitan.
I used Pacifist to install the Java 6 package, since cask threw me an error saying that java 6 could not be installed because of a newer version was installed on my machine (Also after deleting all jdk's from my machine). After Pacifist had placed the java 6 files on it's place, I reran the "brew cask install java6" command in terminal. And this made it work correctly! Thanks for all your help guys!


Code:
$ brew cask install java6
==> Downloading http://support.apple.com/downloads/DL1572/en_US/JavaForOSX2014-0
Already downloaded: /Library/Caches/Homebrew/java6-1.6.0_65.dmg
==> Running installer for java6; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are i
Password:
==> installer: Cannot install on volume / because it is disabled.
==> installer: A newer version of this package is already installed.
Error: Command failed to execute!

==> Failed command:
["/usr/bin/sudo", "-E", "--", "/usr/sbin/installer", "-pkg", "#<Pathname:/opt/homebrew-cask/Caskroom/java6/1.6.0_65/JavaForOSX.pkg>", "-target", "/"]

==> Output of failed command:
installer: Cannot install on volume / because it is disabled.
installer: A newer version of this package is already installed.
Installed Java 6 package using Pacifist at this point.

Code:
$ java -version
Unable to locate a Java Runtime to invoke.
$ brew cask install java6
==> Downloading http://support.apple.com/downloads/DL1572/en_US/JavaForOSX2014-0
Already downloaded: /Library/Caches/Homebrew/java6-1.6.0_65.dmg
==> Running installer for java6; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are i
Password:
==> installer: Package name is Java for OS X 2014-001
==> installer: Upgrading at base path /
==> installer: The upgrade was successful.
  java6 staged at '/opt/homebrew-cask/Caskroom/java6/1.6.0_65' (64M)
$ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.