Bug 74877 - OS X 10.9: abrupt exit of LO in JNI_CreateJavaVM w/ Oracle Java 7 and w/o Apple Java 6
Summary: OS X 10.9: abrupt exit of LO in JNI_CreateJavaVM w/ Oracle Java 7 and w/o App...
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version:
(earliest affected)
4.2.0.0.alpha0+ Master
Hardware: x86-64 (AMD64) macOS (All)
: medium normal
Assignee: Stephan Bergmann
URL: http://bugs.java.com/bugdatabase/view...
Whiteboard:
Keywords:
: 74865 81093 85669 88636 89661 (view as bug list)
Depends on:
Blocks: Java-Runtime-JRE
  Show dependency treegraph
 
Reported: 2014-02-12 08:02 UTC by Stephan Bergmann
Modified: 2016-10-16 11:58 UTC (History)
10 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Bergmann 2014-02-12 08:02:28 UTC
Spawning a fresh issue for part (1) of <https://bugs.freedesktop.org/show_bug.cgi?id=74597#c3>:

"At least on a fresh OS X 10.9.1 with Apple's 'Java for OS X' (<http://support.apple.com/kb/DL1572>) not installed and Oracle's Java 1.7.0_51 (<http://javadl.sun.com/webapps/download/AutoDL?BundleId=83377>) installed, against an --enable-64-bit build of current LO master, I observe [the following]:

"[...] Doing anything in LO that requires Java, like "Tools - Macros - Organize Macros - BeanShell...", abruptly exits LO's soffice with exit code 97, after writing 'No Java runtime present, requesting install' to stderr.  (It may or may not first pop up Apple's stub window asking to install Java.  Appears to me that it does so a couple of time and when you keep pressing 'No' it eventually stops presenting the dialog.)

"The reason is that calling Oracle's JNI_CreateJavaVM exported from /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/server/libjvm.dylib internally calls into Apple's (stubbed-by-default) /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/JavaRuntimeSupport, which then decides to call exit(1).

"This problem goes away once you do install Apple's 'Java for OS X' (i.e., Java 6) alongside Oracle's Java 7.  (And LO does run the Java 7 JVM then, not the Java 6 one, as can be seen, e.g., when modifying the BeanShell HelloWorld macro in 'LibreOffice Macros' to include the result of System.getProperty("java.version") in the text inserted into a Writer document and reports '1.7.0_51'.)"
Comment 1 Stephan Bergmann 2014-02-12 08:02:53 UTC
*** Bug 74865 has been marked as a duplicate of this bug. ***
Comment 2 Stephan Bergmann 2014-02-12 14:13:18 UTC
This is due to <http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7131356> "(props) 'No Java runtime present, requesting install' when creating VM from JNI [macosx]" and there appears to be no way we can defend against that (passing an exit hook into JNI_CreateJavaVM doesn't help, as the relevant call to exit doesn't go through the hook).

As a workaround, install "Java for OS X" (<http://support.apple.com/kb/DL1572>).
Comment 3 retired 2014-02-12 14:37:11 UTC
Priority: P3 at Oracle bugtracker.

Sounds like a rather serious bug preventing work to be done with the latest oracle java on OSX.

Oracle?!? Nobody home?
Comment 4 retired 2014-02-12 14:38:09 UTC
Also target is not Java 1.8 but 1.9. Seriously?
Comment 5 Stephan Bergmann 2014-02-13 08:13:09 UTC
(In reply to comment #3)
> Sounds like a rather serious bug preventing work to be done with the latest
> oracle java on OSX.

I think the workaround of installing "Java for OS X" alongside Oracle's Java 7 (which one gets even prompted to do) is easy (though probably non-intuitive) and should not have negative consequences.
Comment 6 Stephan Bergmann 2014-10-16 06:29:56 UTC
*** Bug 81093 has been marked as a duplicate of this bug. ***
Comment 7 Alex Thurgood 2014-10-20 11:12:53 UTC
The dumb thing is, that on Yosemite at least, the user gets offered a pseudo Safari window with two choices : if the user clicks the more info button, it gets redirected to an Apple page about why Java isn't installed, leading the user to think that it will be installed, but nothing happens...sigh

The user has to pick the other button, in order to gain access to the JavaforOSX2014-001.dmg bundle and then install it separately.
Comment 8 V Stuart Foote 2014-10-31 13:47:15 UTC
*** Bug 85669 has been marked as a duplicate of this bug. ***
Comment 9 V Stuart Foote 2014-10-31 13:49:46 UTC
Can some notice be given, as suggested in bug 85695?
Comment 10 V Stuart Foote 2014-10-31 14:49:14 UTC
For any newly arriving at this issue...

Further to comment 7, direct link to the updated Apple JRE 6 (May 29, 2014) for OS X >= 10.6.8 packages--Java for OS X 2014-001-- remains here:

http://support.apple.com/kb/DL1572

it is compliant with Oracle security patches through JRE 6u69

And the current Oracle JRE 8u25 is here (which resolves an issue of installing earlier JREs).

http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

This Apple technote provides instruction on how to revert from Oracle JRE 7 (assume 8 as well) for plugin to the Apple OS X 2014-001 build if that is preferred (or necessary).

http://support.apple.com/kb/ht5559
Comment 11 Julien Nabet 2015-01-20 20:31:44 UTC
*** Bug 88636 has been marked as a duplicate of this bug. ***
Comment 12 V Stuart Foote 2015-02-25 22:42:49 UTC
*** Bug 89661 has been marked as a duplicate of this bug. ***
Comment 13 V Stuart Foote 2015-03-10 20:54:47 UTC
It is still available for download, but Apple could withdrawn 2014-001 at some point. 

Unfortunately, Oracle is pushing this out to a Java 9 fix per:  http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8024281

The JRE 8u40 available from link in comment 10 will co-exist with Apple Java JRE 2104-001.
Comment 14 frofa 2015-06-23 22:00:34 UTC
I am wondering if Apple's recent announcement (see link below under the 'Java ' heading) that Apple's JRE 1.6 (Apple's Java 2014-001) will NOT be supported after the next version of Mac OSX 10.11 'El Capitan' means that Base will NOT be usable for those who upgrade to Mac OSX 10.12 and beyond?

https://developer.apple.com/library/prerelease/mac/releasenotes/General/rn-osx-10.11/index.html

Also, is there any update on Oracle fixing the Java BUG that prevents their current versions of JRE from running on Mac OSX without also having Apple's JRE 1.6 installed in 'parallel' (as per above discussion).
Comment 15 Stephan Bergmann 2015-06-24 08:41:20 UTC
(In reply to frofa from comment #14)
> I am wondering if Apple's recent announcement (see link below under the
> 'Java ' heading) that Apple's JRE 1.6 (Apple's Java 2014-001) will NOT be
> supported after the next version of Mac OSX 10.11 'El Capitan' means that
> Base will NOT be usable for those who upgrade to Mac OSX 10.12 and beyond?

That depends not on LibreOffice but on whether there will be some JRE available on that OS that does not suffer from <http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7131356>.

> Also, is there any update on Oracle fixing the Java BUG that prevents their
> current versions of JRE from running on Mac OSX without also having Apple's
> JRE 1.6 installed in 'parallel' (as per above discussion).

You can see the status of that Oracle issue at <http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7131356>.
Comment 16 V Stuart Foote 2016-02-12 23:55:14 UTC
added the Oracle ticket for  JDK-8024281 : Mac OS X: stop relying on Apple's JavaVM Frameworks

http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8024281