https://bugs.documentfoundation.org/show_bug.cgi?id=174161
Bug ID: 174161
Summary: MalformedVersionException on macOS with java.version
of five dotted segments (e.g. 25.0.5.0.2, 27.0.1.0.2)
Product: LibreOffice
Version: 26.8.1.1 release
Hardware: ARM
OS: macOS (All)
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: LibreOffice
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Disclaimer, this bug description is based on real user feedback and our
testing, and was partially written with help of AI agents.
Description:
On macOS, Java-based extensions (e.g. the Zotero LibreOffice Integration) fail
to install/run when the selected JRE reports a java.version consisting of five
dotted segments, as used by current Oracle JDK patch releases (e.g.
"25.0.5.0.2", "27.0.1.0.2"). The error is:
(com.sun.star.uno.RuntimeException) { { Message = "C++ code threw
N10jfw_plugin25MalformedVersionExceptionE: std::exception", Context =
(com.sun.star.uno.XInterface) @0 } }
This is the follow-up case to tdf#149202, whose fix ("Allow for java.version
consisting of four dotted segments") handles e.g. "18.0.1.1" but not five
segments.
Analysis:
- jfw_plugin::SunVersion::init
(jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx) accepts at most
major.minor.micro plus one further "." or "_" segment. Compiling the current
master parser standalone: "27", "27.0.1", "27.0.0.1", "21.0.5.1" parse OK;
"25.0.1.0.1", "21.0.4.0.0" (and thus "25.0.5.0.2", "27.0.1.0.2") are rejected.
- Elsewhere this is tolerated (bubbleSortVersion and
checkJavaVersionRequirements catch MalformedVersionException), so such a JRE is
listed and can be selected in Tools > Options > LibreOffice > Advanced.
- But in jfw_plugin_startJavaVirtualMachine (sunjavaplugin.cxx), the #ifdef
MACOSX block calls
aVendorInfo->compareVersions( pInfo->sVersion )
without a try/catch. SunInfo::compareVersions throws
MalformedVersionException when its argument doesn't parse, and the exception
escapes all the way to the user as the RuntimeException above. Hence
macOS-only.
Steps to Reproduce:
1. On macOS (Apple Silicon), install an Oracle JDK whose java.version has five
segments (e.g. 25.0.5.0.2 or 27.0.1.0.2).
2. Select it in LibreOffice > Preferences > LibreOffice > Advanced.
3. Install any Java-based extension (e.g. Zotero's
Zotero_LibreOffice_Integration.oxt) or otherwise trigger JVM startup.
Actual Results:
RuntimeException "C++ code threw N10jfw_plugin25MalformedVersionExceptionE";
the Java extension cannot be installed/used.
Expected Results:
JVM starts normally.
Suggested fix:
- Let SunVersion::init accept additional dotted segments (e.g. ignore/compare
segments beyond the fourth), and add "25.0.5.0.2"-style cases to
jvmfwk/qa/unit/sunversion.cxx.
- Catch MalformedVersionException around the compareVersions call in the MACOSX
block of jfw_plugin_startJavaVirtualMachine.
Workaround: use a JDK whose version has <= 4 segments (e.g. Temurin/Zulu).
User reports:
https://forums.zotero.org/discussion/134415/unable-to-install-zotero-plugin-for-libre-office-mac
https://forums.zotero.org/discussion/134422/zotero-libreoffice-integration-fails-with-malformedversionexception-on-macos
Version information: LibreOffice 26.8.1.1 and 26.2.6.3, macOS 27.0.1, Apple
Silicon (aarch64). Code paths verified against current master.
--
You are receiving this mail because:
You are the assignee for the bug.