Bug 100501 - Support Java9
Summary: Support Java9
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.2.0.0.beta2
Hardware: All All
: medium normal
Assignee: Stephan Bergmann
URL:
Whiteboard: target:6.0.0 target:5.4.2 target:5.3.7
Keywords:
: 112551 112716 (view as bug list)
Depends on:
Blocks: Java-Runtime-JRE
  Show dependency treegraph
 
Reported: 2016-06-20 09:50 UTC by himajin100000
Modified: 2017-10-06 09:32 UTC (History)
8 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 himajin100000 2016-06-20 09:50:19 UTC
STEPS TO REPRODUCE

1. Install Oracle Java9
2. Launch LibreOffice
3. Tool->Options in MainMenu
4. In left pane, click Advanced
5. take a look at right pane.
6. Java 9 is not recognized.

I guess this is caused by

bool SunVersion::init(const char *szVersion)
http://opengrok.libreoffice.org/xref/core/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx#61

not supporting

JEP 223: New Version-String Scheme
http://openjdk.java.net/jeps/223
Comment 1 V Stuart Foote 2016-06-20 15:01:31 UTC
Not that weird, we've come to expect it from Oracle.

Another round similar to bug 39659
Comment 2 Sierk Bornemann 2016-07-25 12:43:31 UTC
FYI (1), attention to this Oracle notes:
----------------------------------------

Oracle, Java Platform Group, Product Management blog (Dec 06, 2015): A New JDK 9 Version String Scheme 
https://blogs.oracle.com/java-platform-group/entry/a_new_jdk_9_version

Oracle, Java Platform Group, Product Management blog (Jan 27, 2016): Moving to a Plugin-Free Web 
https://blogs.oracle.com/java-platform-group/entry/moving_to_a_plugin_free

Oracle/Java.com: JDK 9 and the Java Plugin
https://www.java.com/en/download/faq/jdk9_plugin.xml

[quote=Oracle]
Oracle plans to deprecate the Java browser plugin in Java Standard Edition Development Kit 9 (JDK 9). Deprecation is a warning for developers to stop using this technology. JRE 9 will continue to ship the Java Plugin and support launching applets on browsers that still offer standard plugin support. This browser plugin will be removed from the Oracle JDK and JRE in a future Java SE release.
[/quote]


FYI (2), finding $JAVA_HOME on the OS X/macOS platform with stock system tool:
------------------------------------------------------------------------------

Apple Developer Documentation: Technical Q&A QA1170: Important Java Directories on Mac OS X: Java Home
https://developer.apple.com/library/mac/qa/qa1170/_index.html#//apple_ref/doc/uid/DTS10001702-CH1-SECTION1

Apple Manpage: java_home - return a value for $JAVA_HOME
https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/java_home.1.html:

[quote]
java_home(1)                                                                                    java_home(1)



NAME
       java_home - return a value for $JAVA_HOME


SYNOPSIS
       /usr/libexec/java_home [options]


DESCRIPTION
       The java_home command returns a path suitable for setting the JAVA_HOME environment variable. […]
       Additional  constraints may be provided to filter the list of JVMs available. By default, if no con-straints constraints match the available list of JVMs, the default order is used. The path is printed to standard output.

[…]

-v or --version  version
              Filters  the  returned  JVMs  by the major platform version in "JVMVersion" form. Example versions: "1.5+", or "1.6*".

[…]

-V or --verbose
              Prints the matching list of JVMs and architectures to stderr.

[…]
[/quote]



Examples:

$ /usr/libexec/java_home --verbose
Matching Java Virtual Machines (3):
    9, x86_64:	"Java SE 9-ea"	/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home
    1.8.0_112, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home
    1.8.0_102, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home

$ /usr/libexec/java_home --version 9
/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home

$ /usr/libexec/java_home --version 1.8
/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home
Comment 3 V Stuart Foote 2016-07-25 14:40:13 UTC
@Caolán, Stephen

Are changes going to be needed to sunversion.cxx given this change to naming the Oracle Java builds effective for JDK 9?
Comment 4 Sierk Bornemann 2017-08-28 11:54:45 UTC
Any progress on this issue?

Reminder: Java 9 is just around the corner with General Availability on 2017/09/21 according to http://openjdk.java.net/projects/jdk9/ and its first Release Candidate is out since 2017/08/09 according to http://mail.openjdk.java.net/pipermail/jdk9-dev/2017-August/005940.html.
Comment 5 Commit Notification 2017-08-28 13:46:10 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=52ffad9bb7be800790de6d918154dbeade88cadd

tdf#100501: Adapt to Java 9 (at least on Linux x86-64)

It will be available in 6.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2017-08-28 16:20:28 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cda4cea7cdfc9a8de814b901b3b957f029d36aaf

tdf#100501: Fix thinko

It will be available in 6.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Stephan Bergmann 2017-08-29 09:50:14 UTC
Checking further platforms with Java 9 builds as currently available at <http://jdk.java.net/9/> "JDK 9 Early-Access Builds":

* Checking on macOS with jdk-9+181_osx-x64_bin.dmg, it is automatically detected in "LibreOffice - Preferences... - LibreOffice - Advanced - Java Options" (and will be used as the preferred version if none has been selected yet).

* Checking on Windows with jre-9+181_windows-x64_bin.exe, it can manually be added with "Tools - Options... - LibreOffice - Advanced - Java Options - Add...".  (The reason it isn't detected automatically is probably that older JREs are registered under "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Runtime Environment" while this is registered under "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JRE", cf. getJREInfoFromRegistry in jvmfwk/plugins/sunmajor/pluginlib/util.cxx).
Comment 8 Commit Notification 2017-08-29 12:37:36 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c83aec1d026b9567e7e6d982e4d19f3a566b66d2&h=libreoffice-5-4

tdf#100501: Adapt to Java 9 (at least on Linux x86-64)

It will be available in 5.4.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2017-08-29 16:45:54 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a2fb0739bd1a9823f9b52f8efabae0bcf9ff6b0c&h=libreoffice-5-3

tdf#100501: Adapt to Java 9 (at least on Linux x86-64)

It will be available in 5.3.7.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Sierk Bornemann 2017-09-06 00:14:40 UTC
Daily builds that contain this fix for testing on macOS platform are where?
The last daily build for macOS platform on http://dev-builds.libreoffice.org/daily/ is from 2017-Aug-25. Since then no further daily builds for macOS platform have been published, whereas daily builds for Linux and Windows platform still are build and published daily or nearly daily (as the name suggests). Is the build server for macOS platform temporary out of order or paused? 



(In reply to Stephan Bergmann from comment #7)
> Checking further platforms with Java 9 builds as currently available at
> <http://jdk.java.net/9/> "JDK 9 Early-Access Builds":
> 
> * Checking on macOS with jdk-9+181_osx-x64_bin.dmg, it is automatically
> detected in "LibreOffice - Preferences... - LibreOffice - Advanced - Java
> Options" (and will be used as the preferred version if none has been
> selected yet).

[…]

(In reply to Stephan Bergmann from comment #8)
>It will be available in 5.4.2.

>The patch should be included in the daily builds available at
>http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
>information about daily builds can be found at:
>http://wiki.documentfoundation.org/Testing_Daily_Builds
>
>Affected users are encouraged to test the fix and report feedback.
Comment 11 Stephan Bergmann 2017-09-06 09:25:01 UTC
(In reply to Sierk Bornemann from comment #10)
> Daily builds that contain this fix for testing on macOS platform are where?
> The last daily build for macOS platform on
> http://dev-builds.libreoffice.org/daily/ is from 2017-Aug-25. Since then no
> further daily builds for macOS platform have been published, whereas daily
> builds for Linux and Windows platform still are build and published daily or
> nearly daily (as the name suggests). Is the build server for macOS platform
> temporary out of order or paused? 

on #libreoffice-dev:
Sep 06 08:45:40 <sberg> cloph, <https://bugs.documentfoundation.org/show_bug.cgi?id=100501#c10> is asking for macOS daily builds, and <https://lists.freedesktop.org/archives/libreoffice/2017-August/078360.html> "Christian’s box is the only one providing daily builds for macOS" makes it sound like you /do/ provide such?
Sep 06 11:22:33 <cloph> sberg: yes, until it stops working and I don't notice.. /me kicks it...
Sep 06 11:23:46 <cloph> sberg: but it is true that it is the only daily build provider - jenkins bots do fill bibisect repo though.
Comment 12 Stephan Bergmann 2017-09-28 15:41:20 UTC
*** Bug 112716 has been marked as a duplicate of this bug. ***
Comment 13 Alex Thurgood 2017-09-28 15:53:59 UTC
Confirming that on my own master build :

Version: 6.0.0.0.alpha0+
Build ID: 4bf3b4ee48c4e3556e257aa77940f68c13b05b54
CPU threads: 4; OS: Mac OS X 10.12.6; UI render: default; 
Locale: fr-FR (fr_FR.UTF-8); Calc: group

Java 9 is automatically recognized.
Comment 14 Alex Thurgood 2017-09-28 15:58:18 UTC
*** Bug 112609 has been marked as a duplicate of this bug. ***
Comment 15 Alex Thurgood 2017-09-28 16:02:20 UTC
*** Bug 112551 has been marked as a duplicate of this bug. ***