Closed Bug 668639 Opened 13 years ago Closed 13 years ago

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

Categories

(Core Graveyard :: Plug-ins, defect, P1)

All
macOS
defect

Tracking

(firefox5+ .1-fixed, firefox6+ fixed, firefox7+ fixed)

VERIFIED FIXED
Tracking Status
firefox5 + .1-fixed
firefox6 + fixed
firefox7 + fixed

People

(Reporter: nate, Assigned: smichaud)

References

()

Details

(Keywords: verified-beta, Whiteboard: rdar://9713559 [qa!])

Attachments

(1 file)

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.
Reverting to Firefox 3.6.18 does allow java to load properly.
OS: Other → Mac OS X
Hardware: All → x86_64
Component: General → Plug-ins
Product: Firefox → Core
QA Contact: general → plugins
Please provide a testcase -- a URL to a Java applet that fails to load.
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
Component: Plug-ins → Java (Apple)
Product: Core → Plugins
QA Contact: plugins → apple-java
Hardware: x86_64 → All
Version: 5 Branch → unspecified
> 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.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Java not working in firefox 5 after java for mac os x 10.5 update 10 install → Apple's Java for Mac OS X 10.5 Update 10 breaks Java in FF 4 and up
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.
Severity: normal → critical
Priority: -- → P1
> 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.
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).
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.
Whiteboard: rdar://9713559
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.
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.
> 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.
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.
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.
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.
(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.
(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.
(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.
Attached patch Workaround patchSplinter Review
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.
Assignee: nobody → smichaud
Attachment #544346 - Flags: review?(bgirard)
(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
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 :-(
(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
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.
If we ship with the workaround and Apple later "fixes" the issue, will everything still be fine?
(In reply to comment #25)

Yes.  Even with my patch, FF always looks first for plugins in the "normal" locations.
Comment on attachment 544346 [details] [diff] [review]
Workaround patch

r+
Attachment #544346 - Flags: review?(bgirard) → review+
Moving this back to Core : Plugins to make more approval flags available.
Assignee: smichaud → nobody
Component: Java (Apple) → Plug-ins
Product: Plugins → Core
QA Contact: apple-java → plugins
Assignee: nobody → smichaud
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.
Attachment #544346 - Flags: approval-mozilla-beta?
Attachment #544346 - Flags: approval-mozilla-aurora?
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
Attachment #544346 - Flags: approval-mozilla-beta?
Attachment #544346 - Flags: approval-mozilla-beta+
Attachment #544346 - Flags: approval-mozilla-aurora?
Attachment #544346 - Flags: approval-mozilla-aurora+
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Attachment #544346 - Flags: approval-mozilla-release+
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.
(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?
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.
(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.
(In reply to comment #38)

You should (I think) be able to start the Java download by clicking on the missing plugin error message.
(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.
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.
Status: RESOLVED → VERIFIED
(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.
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
Status: VERIFIED → RESOLVED
Closed: 13 years ago13 years ago
qa+ for verification in Firefox 7
Whiteboard: rdar://9713559 → rdar://9713559 [qa+]
(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.
Thanks, marking VERIFIED
Status: RESOLVED → VERIFIED
Keywords: verified-beta
Whiteboard: rdar://9713559 [qa+] → rdar://9713559 [qa!]
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: