Last Comment Bug 668639 - Apple's Java for Mac OS X 10.5 Update 10 breaks Java in FF 4 and up
: Apple's Java for Mac OS X 10.5 Update 10 breaks Java in FF 4 and up
Status: VERIFIED FIXED
rdar://9713559 [qa!]
: verified-beta
Product: Core
Classification: Components
Component: Plug-ins (show other bugs)
: unspecified
: All Mac OS X
: P1 critical with 1 vote (vote)
: ---
Assigned To: Steven Michaud [:smichaud] (Retired)
:
: Benjamin Smedberg [:bsmedberg]
Mentors:
http://java.sun.com/applets/jdk/1.4/d...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-30 14:29 PDT by nate
Modified: 2011-09-22 18:03 PDT (History)
23 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
+
.1-fixed
+
fixed
+
fixed


Attachments
Workaround patch (6.26 KB, patch)
2011-07-06 14:39 PDT, Steven Michaud [:smichaud] (Retired)
b56girard: review+
christian: approval‑mozilla‑aurora+
christian: approval‑mozilla‑beta+
dveditz: approval‑mozilla‑release+
Details | Diff | Splinter Review

Description nate 2011-06-30 14:29:17 PDT
User Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1

Steps to reproduce:

Installed the Java for Mac OS X 10.5 update 10 update


Actual results:

Java no longer loads in firefox 5.  it works fine in Safari.  Java enabled web pages tell me Java is not installed when visiting them in firefox.


Expected results:

Java should load in firefox 5.
Comment 1 nate 2011-06-30 14:30:42 PDT
Reverting to Firefox 3.6.18 does allow java to load properly.
Comment 2 Steven Michaud [:smichaud] (Retired) 2011-06-30 16:16:21 PDT
Please provide a testcase -- a URL to a Java applet that fails to load.
Comment 3 nate 2011-07-01 06:16:03 PDT
It appears to happen with any Java applet, but I've added a URL above.  In case that's the wrong spot, the URL I added was http://www.cafeaulait.org/books/jdr/examples/13/13.1.html
Comment 4 Steven Michaud [:smichaud] (Retired) 2011-07-01 10:23:26 PDT
> http://www.cafeaulait.org/books/jdr/examples/13/13.1.html

This applet doesn't load properly in any browser.  There must be
something wrong with it, or (more likely) with the site from which
it's loaded.  So it won't do as an example.

But it turns out you're right -- Apple's Java for Mac OS X 10.5 Update
10 breaks Java in Firefox 4.0 and up.  Here's a better example:

http://java.sun.com/applets/jdk/1.4/demo/applets/Clock/example1.html

When you visit this URL you get the missing plugin icon.

This bug is entirely Apple's fault.  For some reason Update 10 removes
the JavaPlugin2_NPAPI.plugin soft link from /Library/Internet
Plugin-Ins/ (and also the ability, in the Java Preferences utility, to
choose whether to run applets "in their own process" or "within the
browser process").

JavaPlugin2_NPAPI.plugin is still present on the system, where the
Java Embedding Plugin can still find it.  So Java still works in FF
3.6.18 and earlier.  And so this bug is relatively easy for a somewhat
sophisticated user to work around:

Just do the following at a Terminal prompt.  For it to work, you'll
need to be logged in using an account with administrator privileges.

$ cd "/Library/Internet Plug-Ins/"
$ sudo ln -s /System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI.plugin

But this isn't something we can reasonably ask naive users to do.
Comment 5 Steven Michaud [:smichaud] (Retired) 2011-07-01 10:28:22 PDT
For some reason Apple's Java for Mac OS X 10.6 Update 5, released at
the same time a few days ago, doesn't get rid of the
JavaPlugin2_NPAPI.plugin soft link (or the ability to choose whether
to run applets "in their own process" or "within the browser
process").

We need to pull chains at Apple to find out why they made this change
to Java on OS X 10.5, and (if possible) to get them to reverse it
quickly.
Comment 6 Steven Michaud [:smichaud] (Retired) 2011-07-01 10:56:01 PDT
> JavaPlugin2_NPAPI.plugin is still present on the system, where the
> Java Embedding Plugin can still find it.

Mind fart.  The JEP doesn't use JavaPlugin2_NPAPI.plugin.  The JEP
does use other Java resources, which are also still present on the
system where the JEP can find them.
Comment 7 Steven Michaud [:smichaud] (Retired) 2011-07-01 11:01:06 PDT
Side note:  The reason Java still works in Safari (after Update 10) is
that Safari doesn't (by default) use JavaPlugin2_NPAPI.plugin.
Instead it uses the WebKit-specific JavaPluginCocoa.bundle (whose soft
link hasn't been deleted).
Comment 8 Steven Michaud [:smichaud] (Retired) 2011-07-01 14:25:34 PDT
I've just submitted the following bug report to Apple.  Its radar
number is 9713559.

Apple's Java for Mac OS X 10.5 Update 10 breaks Java in Firefox 4 and up

The installer for Apple's current update (Update 10) for Java on OS X
10.5.X deletes the soft link in /Library/Internet Plug-Ins/ to
JavaPlugin2_NPAPI.plugin.

Firefox 4 and up require Apple's port of Sun/Oracle's Java Plugin2 to
support Java.  Java Plugin2 is still available with Java for Mac OS X
10.5 Update 10, and still works with Firefox 4 and up.  But without
the shortcut in /Library/Internet Plug-Ins/, Firefox is no longer able
to find it.  So every attempt to display a Java applet results in
Firefox displaying the missing plugin icon.

One possible workaround is to tell our users to do the following at a
Terminal prompt:

$ cd "/Library/Internet Plug-Ins/"
$ sudo ln -s /System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI.plugin

But this isn't something we can ask naive users to do.

Why does the installer for Update 10 remove this soft link?  Java for
Mac OS X 10.6 Update 5, released on the same date, doesn't do so.

Was this just a mistake?  If so, please quickly release another update
to correct it.

This issue was initially reported at
https://bugzilla.mozilla.org/show_bug.cgi?id=668639, and is being
followed there.
Comment 9 Steven Michaud [:smichaud] (Retired) 2011-07-04 16:42:52 PDT
This bug also effects Chrome, but (interestingly) not Opera.
Apparently Opera knows to look for Java Plugin2 in its "original"
location (at
/System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI.plugin).

This assuredly isn't one of the standard locations to look for
plugins.  But unless Apple fixes this bug quickly, we may have to do
something similar to work around it.
Comment 11 Steven Michaud [:smichaud] (Retired) 2011-07-05 09:10:08 PDT
The change that caused this bug (deleting the shortcut to Java Plugin2
from /Library/Internet Plug-Ins/) was deliberate, so Apple is unlikely
to reverse it.  In effect they've deprecated Java Plugin2 on OS X
10.5:

http://lists.apple.com/archives/java-dev/2011/Jun/msg00115.html

I'm quite sure Apple wouldn't have done this if Safari didn't have an
alternative way to support Java applet (the WebKit-specific
JavaPluginCocoa.bundle).  But Firefox (like Chrome and Opera) has no
alternative to using Java Plugin2.	

I'll be	writing a patch to get around Apple's change.  I should be
able to post it here in the next day or two.

As I mentioned above, the Java Embedding Plugin (bundled with FF 3.6.X
and earlier) still works fine with Apple's latest Java update for OS X
10.5:  It doesn't use Java Plugin2, and is still able to find all the
resources it needs.  So someone	who's desperate to use a particular
Java applet, and who isn't comfortable using the workaround from
comment #4, can use FF 3.6.X to run that applet.  But I don't think
it's reasonable to ask everyone to downgrade to FF 3.6.X to get around
Apple's breakage.

We have no choice but to continue using Java Plugin2 on OS X 10.5.X.
But Apple's deprecation of it suggests that more Java applets will
break, or not work entirely correctly, using Update 10's copy of Java
Plugin2.  I will do some testing in the next few days, but we all need
to keep an eye out for this.
Comment 12 Steven Michaud [:smichaud] (Retired) 2011-07-05 09:11:58 PDT
(In reply to comment #10)

Scoobidiver, I've answered your questions here:

https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox/discuss/1578#post-2913
Comment 13 Steven Michaud [:smichaud] (Retired) 2011-07-05 09:30:28 PDT
> http://lists.apple.com/archives/java-dev/2011/Jun/msg00115.html

This message, referenced above, claims that Java for Mac OS X 10.5
Update 10 removes Java Plugin2.  Very fortunately this isn't true.

The installer does remove the soft link to Java Plugin2 from
/Library/Internet Plug-Ins/.  But it doesn't remove Java Plugin2
itself (the target of the soft link), and in fact appears to update it
-- JavaForMacOSX10.5Update10.pkg includes the JavaPlugin2_NPAPI.plugin
bundle.
Comment 14 Mike Swingler 2011-07-05 11:22:12 PDT
We documented that we were removing support for Plugin2 on Mac OS X 10.5 Leopard in the release notes of Update 10: <http://developer.apple.com/library/mac/#releasenotes/Java/JavaSnowLeopardUpdate5LeopardUpdate10RN>

From the "New and Notable" section:
Due to the lack of advanced cross-process communication features in the OS and the graphics system in J2SE 5.0, it will not be feasible to deliver an acceptable user experience in Plugin2 on Mac OS X 10.5 Leopard. The in-process applet plug-in (Plugin1) will remain the default, and the user interface to activate Plugin2 has been removed from Java Preferences.

Users with Intel-based Macs are encouraged to upgrade to Mac OS X 10.6 Snow Leopard to receive security updates and experience applets in Plugin2.
Comment 15 Mike Swingler 2011-07-05 11:24:31 PDT
I would like to reiterate: we very strongly encourage Intel Mac users to upgrade to Snow Leopard. This is effectively a non-issue for PPC users, because Firefox 5 and Chrome only run on Intel Macs.
Comment 16 Cameron Kaiser [:spectre] 2011-07-05 14:48:38 PDT
Yes, but it does hit TenFourFox users. We're directing those who feel able to do this to use the symlink approach, although due to 10.5's impending sunset we're simply going to disable Java and plugins altogether in TenFourFox 6. Still, I want it on the record that it is not a non-issue for PPC users as it stands.
Comment 17 Steven Michaud [:smichaud] (Retired) 2011-07-05 15:39:02 PDT
(In reply to comment #14 and comment #15)

> we very strongly encourage Intel Mac users to upgrade to Snow
> Leopard

Noted, but with a degree of skepticism.  I certainly don't want to
discourage people from doing this.  But in my experience Mac users
(like Windows users) generally don't upgrade from the major OS version
their computer came with.

I think Mozilla should continue to support Leopard (OS X 10.5.8) for
as long as Apple continues to offer reasonably full support for it
(basically for as long as Apple continues to provide security
updates).  This includes continuing to make it possible to use Java
applets on Leopard.

> Users with Intel-based Macs are encouraged to upgrade to Mac OS X
> 10.6 Snow Leopard to receive security updates ...

Which "security updates" are you referring to?  For the OS or for
Java?

If Apple conforms to past practice, they'll keep releasing security
updates for OS X 10.5.8 for several months after OS X 10.7 is
released.  (OS X 10.6 was released in May 2009, and the last security
update for OS X 10.4.11 (Security Update 2009-005) was released in
September 2009.)

Since Safari still uses Java on OS X 10.5.8 (via the WebKit-specific
Java plugin), Apple will surely keep releasing security updates for
Java as a whole on Leopard (for as long as the OS itself remains
supported).

Mozilla does have to start to think about desupporting OS X Leopard
(presumably some time after Apple desupports it).  But I don't think
we have to desupport Java on Leopard any earlier than we'd desupport
Leopard itself.
Comment 18 Mike Swingler 2011-07-05 17:12:17 PDT
(In reply to comment #17)

> I think Mozilla should continue to support Leopard (OS X 10.5.8) for
> as long as Apple continues to offer reasonably full support for it
> (basically for as long as Apple continues to provide security
> updates).

You make an excellent point.

> If Apple conforms to past practice, they'll keep releasing security
> updates for OS X 10.5.8 for several months after OS X 10.7 is
> released.

I am not going to speculate on a public forum about any security update time-tables for any products. I only suggest that Leopard users with Intel Macs should upgrade to Snow Leopard.
Comment 19 G. Brown 2011-07-05 19:51:28 PDT
(In reply to comment #8)

Thanks so much to Steven Michaud and others on this thread -- the info. was exactly what I needed.  I'm running Mac OS X 10.5.8.  I downloaded Java 1.6.0_26 a few days ago, but then it wouldn't work in Firefox 5.0 (or Google Chrome 12.0.742.112, for that matter.)  I'm not an especially advanced user, but I was able to follow the workaround on Comment #8 and all seems to be well now.
Comment 20 Steven Michaud [:smichaud] (Retired) 2011-07-06 14:39:47 PDT
Created attachment 544346 [details] [diff] [review]
Workaround patch

Here's a patch that works around this bug.

It "repurposes" an existing bit of code that's long obsolete, and in
fact doesn't work properly (because its call to
NS_NewNativeLocalFile() doesn't set 'rv', and the value of 'rv' in
nsAppFileLocationProvider::GetFile() currently defaults to
NS_ERROR_FAILURE).

(In the early days of Apple's port of Sun/Oracle's Java Plugin2 (when
it hadn't yet attained alpha quality), Apple "hid" it where browsers
wouldn't ordinarily look for it.  Apple stopped doing this in their
first post-SnowLeopard Java updates, around the beginning of 2010.)

I'd normally ask Josh to review this patch, but he's now busy with
other things.  Benoit, please let me know if you'd prefer that I find
someone else than you to review it.

The patch contains one "drive-by" change to fix a compiler warning,
which is unrelated to this bug:

-    OSType folderType = aLocal ? kCachedDataFolderType : kDomainLibraryFolderType;
+    OSType folderType = aLocal ? (OSType) kCachedDataFolderType : (OSType) kDomainLibraryFolderType;

I'm doing a tryserver build, which should be available by tomorrow
morning for testing.
Comment 21 Zandr Milewski [:zandr] 2011-07-07 07:32:47 PDT
(In reply to comment #17)
> If Apple conforms to past practice, they'll keep releasing security
> updates for OS X 10.5.8 for several months after OS X 10.7 is
> released.  (OS X 10.6 was released in May 2009, and the last security
> update for OS X 10.4.11 (Security Update 2009-005) was released in
> September 2009.)

A bit of a tangent, but I was just looking at these dates: 10.6 actually shipped at the end of August, the last security update for 10.4 followed 13 days later.

10.4 shipped 29 Apr 05, Last 10.2 update 15 Jan 05, 94 days earlier
10.5 shipped 26 Oct 07, Last 10.3 update 14 Nov 17, 19 days later (w/10.5.1)
10.6 shipped 28 Aug 09, Last 10.4 update 10 Sep 09, 13 days later (w/10.6.1)

In both of the last two cases, the last security update for the N-2 OS shipped within a day of the N.1 release
Comment 22 Steven Michaud [:smichaud] (Retired) 2011-07-07 07:58:09 PDT
Zandr, you seem to be right about the release date for 10.6.  Mine was wrong.  Sorry.

Where did you get the date?

I got mine from the list of "Mac OS X"-related developer downloads at http://connect.apple.com/.  I chose the date of the 10.6 gold master listed there (build 10A432) ... or so I thought I did.  But apparently I spaced out and chose the date of the 10.6 DP just prior to the GM, build 10A354 :-(
Comment 23 Zandr Milewski [:zandr] 2011-07-07 08:07:57 PDT
(In reply to comment #22)
> Zandr, you seem to be right about the release date for 10.6.  Mine was
> wrong.  Sorry.

No worries. I've been staring at this trying to plan for build and test hardware for the 10.5 and 10.6 lifecycle.

> Where did you get the date?

http://en.wikipedia.org/wiki/History_of_Mac_OS_X#Release_timeline
http://www.robservatory.com/?p=46
...and countless tech press stories.

And the security update info from:
http://support.apple.com/kb/HT1222
http://support.apple.com/kb/HT4218
http://support.apple.com/kb/HT1263
Comment 24 Steven Michaud [:smichaud] (Retired) 2011-07-07 08:44:17 PDT
Here's a tryserver build made with my patch from comment #20:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/smichaud@pobox.com-d0f73429c3a4/try-macosx64/firefox-8.0a1.en-US.mac.dmg

Please test with it if you've installed Java for Mac OS X 10.5 Update 10 and haven't tried my workaround from comment #8.  Or you can undo the workaround by reinstalling Update 10, then test my tryserver build.

There were no non-spurious test failures during the tryserver builds.
Comment 25 christian 2011-07-07 10:25:12 PDT
If we ship with the workaround and Apple later "fixes" the issue, will everything still be fine?
Comment 26 Steven Michaud [:smichaud] (Retired) 2011-07-07 10:35:44 PDT
(In reply to comment #25)

Yes.  Even with my patch, FF always looks first for plugins in the "normal" locations.
Comment 27 Benoit Girard (:BenWa) 2011-07-07 11:44:36 PDT
Comment on attachment 544346 [details] [diff] [review]
Workaround patch

r+
Comment 28 Steven Michaud [:smichaud] (Retired) 2011-07-07 11:53:12 PDT
Moving this back to Core : Plugins to make more approval flags available.
Comment 29 Steven Michaud [:smichaud] (Retired) 2011-07-07 11:55:12 PDT
Comment on attachment 544346 [details] [diff] [review]
Workaround patch

This is intended to become part of a 5.0.1 chemspill, but I don't know how to request approval for that, or even which branch I'd need to land it on.
Comment 30 christian 2011-07-07 12:18:48 PDT
Comment on attachment 544346 [details] [diff] [review]
Workaround patch

Approved for releases/mozilla-aurora and releases/mozilla-beta. We'll transplant if we need to into releases/mozilla-release
Comment 31 Steven Michaud [:smichaud] (Retired) 2011-07-07 12:27:26 PDT
Comment on attachment 544346 [details] [diff] [review]
Workaround patch

Landed on mozilla-central:
http://hg.mozilla.org/mozilla-central/rev/763ff2d737e7
Comment 32 Steven Michaud [:smichaud] (Retired) 2011-07-07 13:05:03 PDT
Comment on attachment 544346 [details] [diff] [review]
Workaround patch

Landed on aurora:
http://hg.mozilla.org/releases/mozilla-aurora/rev/af0f6aabdcba
Comment 33 Steven Michaud [:smichaud] (Retired) 2011-07-07 13:05:50 PDT
Comment on attachment 544346 [details] [diff] [review]
Workaround patch

Landed on beta:
http://hg.mozilla.org/releases/mozilla-beta/rev/57326051c05e
Comment 34 Daniel Veditz [:dveditz] 2011-07-07 18:57:02 PDT
http://hg.mozilla.org/releases/mozilla-release/rev/b38f9a2ea79a
Comment 35 Al Billings [:abillings] 2011-07-08 13:37:26 PDT
I note that with 5.0.1 on OS X 10.7 (migrated from 10.6.7), I get the missing plugin error on http://java.sun.com/applets/jdk/1.4/demo/applets/Clock/example1.html.
Comment 36 Steven Michaud [:smichaud] (Retired) 2011-07-08 13:46:01 PDT
(In reply to comment #35)

Java isn't available by default on 10.7 -- it's a separate download.

But I've never tested with a 10.7-over-10.6 upgrade.

What happens when you try to load the same URL in Safari or Chrome?  And afterwards do you still get the same error with 5.0.1?
Comment 37 Al Billings [:abillings] 2011-07-08 13:47:07 PDT
Running 5.0.1 on OS X 10.6.8 with http://java.sun.com/applets/jdk/1.4/demo/applets/Clock/example1.html shows the clock fine though.
Comment 38 Al Billings [:abillings] 2011-07-08 13:48:28 PDT
(In reply to comment #36)
> (In reply to comment #35)
> 
> Java isn't available by default on 10.7 -- it's a separate download.
> 
> But I've never tested with a 10.7-over-10.6 upgrade.
> 
> What happens when you try to load the same URL in Safari or Chrome?  And
> afterwards do you still get the same error with 5.0.1?

I see the same behavior in Safari on 10.7.
Comment 39 Steven Michaud [:smichaud] (Retired) 2011-07-08 13:52:05 PDT
(In reply to comment #38)

You should (I think) be able to start the Java download by clicking on the missing plugin error message.
Comment 40 Steven Michaud [:smichaud] (Retired) 2011-07-08 13:54:07 PDT
(In reply to comment #39)

Now I remember that Java applets are also off by default on 10.7.  You can turn them on in Java Preferences or (I think) by clicking on the missing plugin icon and following the prompts.
Comment 41 Vlad [QA] 2011-07-14 00:38:19 PDT
Setting resolution to  Verified Fixed on Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0) Gecko/20100101 Firefox/6.0 (beta2)

I've tested if java is working here http://www.java.com/en/download/testjava.jsp and it's working just  fine.
Comment 42 Jim Carr 2011-07-22 04:18:00 PDT
(In reply to comment #41)
> Setting resolution to  Verified Fixed on Mozilla/5.0 (Macintosh; Intel Mac
> OS X 10.6; rv:6.0) Gecko/20100101 Firefox/6.0 (beta2)
> 
> I've tested if java is working here
> http://www.java.com/en/download/testjava.jsp and it's working just  fine.

I've tested if java is working here http://www.java.com/en/download/testjava.jsp and it's NOT working. It says "Something is wrong. Java isn't working." Clock page above also doesn't work. Only Java update I have not applied is the Java for Lion which I wouldn't think was a good idea on Snow Leopard. Software update doesn't suggest it.

OS X 10.6.8, Firefox 6.0b2 build 2011071371652. I have told NoScript that sun.com is OK.
Comment 43 Scoobidiver (away) 2011-07-22 04:45:57 PDT
The patch is for OS X 10.5, so I marked the status as resolved instead of verified because of comment 41.

Jim, your issue is about OS X 10.6 and seems unrelated to this bug or is the side effect of the patch, so ask your question in the support forum: https://support.mozilla.com/en-US/questions/new
Comment 44 Anthony Hughes (:ashughes) [GFX][QA][Mentor] 2011-09-22 15:41:03 PDT
qa+ for verification in Firefox 7
Comment 45 Jim Carr 2011-09-22 17:55:40 PDT
(In reply to Jim Carr from comment #42)
> (In reply to comment #41)
> > Setting resolution to  Verified Fixed on Mozilla/5.0 (Macintosh; Intel Mac
> > OS X 10.6; rv:6.0) Gecko/20100101 Firefox/6.0 (beta2)
> > 
> > I've tested if java is working here
> > http://www.java.com/en/download/testjava.jsp and it's working just  fine.
> 
> I've tested if java is working here
> http://www.java.com/en/download/testjava.jsp and it's NOT working. It says
> "Something is wrong. Java isn't working." Clock page above also doesn't
> work. Only Java update I have not applied is the Java for Lion which I
> wouldn't think was a good idea on Snow Leopard. Software update doesn't
> suggest it.

I am now using Firefox 7.0b6 Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0) Gecko/20100101 Firefox/7.0 ID:20110916091512 and the above Java test page works fine for me.
Comment 46 Anthony Hughes (:ashughes) [GFX][QA][Mentor] 2011-09-22 18:03:11 PDT
Thanks, marking VERIFIED

Note You need to log in before you can comment on or make changes to this bug.