mason.nvim icon indicating copy to clipboard operation
mason.nvim copied to clipboard

ltex-ls does not work with system on openjdk 24

Open aplund opened this issue 9 months ago • 3 comments

I've searched open issues for similar requests

  • [x] Yes

I've manually reviewed logs to find potential errors

  • [x] Yes

I've recently downloaded the latest plugin version of mason.nvim

  • [x] Yes

Problem description

The ltex-ls package doesn't work with openjdk 24. The process fails with a terminal error. It looks like it's related to using a very old version of the Google Guava package:

Expected behavior

Working language server.

Steps to reproduce

  1. Have openjdk 24 installed (I'm on 'openjdk 24.0.1 2025-03-18')
  2. Use the ltex-ls language server

Affected packages

ltex-ls

Neovim version (>= 0.7)

NVIM v0.11.0 Build type: RelWithDebInfo LuaJIT 2.1.1741730670

Operating system/version

Linux discovery 6.13.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Sun, 23 Mar 2025 17:17:30 +0000 x86_64 GNU/Linux

Healthcheck

==============================================================================
mason:                                         require("mason.health").check()

mason.nvim ~
- OK mason.nvim version v1.11.0
- OK PATH: prepend
- OK Providers: 
    mason.providers.registry-api
    mason.providers.client
- OK neovim version >= 0.7.0

mason.nvim [Registries] ~
- OK Registry `github.com/mason-org/mason-registry version: 2025-04-01-bouncy-curve` is installed.

mason.nvim [Core utils] ~
- OK unzip: `UnZip 6.00 of 20 April 2009, by Info-ZIP.  Maintained by C. Spieler.  Send`
- OK wget: `GNU Wget 1.25.0 built on linux-gnu.`
- OK curl: `curl 8.12.1 (x86_64-pc-linux-gnu) libcurl/8.12.1 OpenSSL/3.4.1 zlib/1.3.1 brotli/1.1.0 zstd/1.5.7 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.1 nghttp2/1.65.0 nghttp3/1.8.0`
- OK gzip: `gzip 1.13`
- OK tar: `tar (GNU tar) 1.35`
- OK bash: `GNU bash, version 5.2.37(1)-release (x86_64-pc-linux-gnu)`
- OK sh: `Ok`

mason.nvim [Languages] ~
- WARNING Ruby: not available
  - ADVICE:
    - spawn: ruby failed with exit code - and signal -. ruby is not executable
- WARNING Composer: not available
  - ADVICE:
    - spawn: composer failed with exit code - and signal -. composer is not executable
- WARNING PHP: not available
  - ADVICE:
    - spawn: php failed with exit code - and signal -. php is not executable
- WARNING RubyGem: not available
  - ADVICE:
    - spawn: gem failed with exit code - and signal -. gem is not executable
- OK Go: `go version go1.24.1 linux/amd64`
- WARNING javac: not available
  - ADVICE:
    - spawn: javac failed with exit code - and signal -. javac is not executable
- OK cargo: `cargo 1.85.1 (d73d2caf9 2024-12-31)`
- OK java: `openjdk version "24.0.1" 2025-03-18`
- WARNING julia: not available
  - ADVICE:
    - spawn: julia failed with exit code 1 and signal 0. Error: The Julia launcher failed to figure out which juliaup channel to use.

- OK node: `v23.9.0`
- OK python: `Python 3.13.2`
- OK luarocks: `/usr/bin/luarocks 3.11.1`
- OK npm: `11.2.0`
- OK pip: `pip 25.0.1 from /usr/lib/python3.13/site-packages/pip (python 3.13)`
- OK python venv: `Ok`

mason.nvim [GitHub] ~
- OK GitHub API rate limit. Used: 0. Remaining: 5000. Limit: 5000. Reset: Tue 01 Apr 2025 15:13:30.

Screenshots or recordings

WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.google.common.cache.Striped64 (file:/home/lund/.local/share/nvim/mason/packages/ltex-ls/ltex-ls-16.0.0/lib/guava-27.1-jre.jar)
WARNING: Please consider reporting this to the maintainers of class com.google.common.cache.Striped64
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
java.lang.RuntimeException: Could not activate rules
	at org.languagetool.JLanguageTool.<init>(JLanguageTool.java:343)
	at org.languagetool.JLanguageTool.<init>(JLanguageTool.java:302)
	at org.languagetool.JLanguageTool.<init>(JLanguageTool.java:362)
	at org.bsplines.ltexls.languagetool.LanguageToolJavaInterface.<init>(LanguageToolJavaInterface.kt:55)
	at org.bsplines.ltexls.settings.SettingsManager.reinitializeLanguageToolInterface(SettingsManager.kt:76)
	at org.bsplines.ltexls.settings.SettingsManager.initialize(SettingsManager.kt:65)
	at org.bsplines.ltexls.settings.SettingsManager.<init>(SettingsManager.kt:56)
	at org.bsplines.ltexls.server.LtexLanguageServer.<init>(LtexLanguageServer.kt:41)
	at org.bsplines.ltexls.LtexLanguageServerLauncher$Companion.launch(LtexLanguageServerLauncher.kt:251)
	at org.bsplines.ltexls.LtexLanguageServerLauncher.launchServer(LtexLanguageServerLauncher.kt:204)
	at org.bsplines.ltexls.LtexLanguageServerLauncher.call(LtexLanguageServerLauncher.kt:139)
	at org.bsplines.ltexls.LtexLanguageServerLauncher.call(LtexLanguageServerLauncher.kt:41)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
	at picocli.CommandLine.access$1300(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
	at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
	at picocli.CommandLine.execute(CommandLine.java:2078)
	at org.bsplines.ltexls.LtexLanguageServerLauncher$Companion.main(LtexLanguageServerLauncher.kt:223)
	at org.bsplines.ltexls.LtexLanguageServerLauncher.main(LtexLanguageServerLauncher.kt)
Caused by: java.io.IOException: Cannot load or parse input stream of '/org/languagetool/rules/en/grammar.xml'
	at org.languagetool.rules.patterns.PatternRuleLoader.getRules(PatternRuleLoader.java:78)
	at org.languagetool.Language.getPatternRules(Language.java:637)
	at org.languagetool.JLanguageTool.activateDefaultPatternRules(JLanguageTool.java:643)
	at org.languagetool.JLanguageTool.<init>(JLanguageTool.java:336)
	... 21 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 193; JAXP00010004: The accumulated size of entities is "100,009" that exceeded the "100,000" limit set by "jdk.xml.totalEntitySizeLimit".
	at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.checkLimit(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.checkEntityLimit(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanContent(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source)
	at java.xml/javax.xml.parsers.SAXParser.parse(Unknown Source)
	at org.languagetool.rules.patterns.PatternRuleLoader.getRules(PatternRuleLoader.java:75)
	... 24 more

aplund avatar Apr 01 '25 18:04 aplund

Is there any workaround for this currently?

lokesh-krishna avatar Jun 01 '25 16:06 lokesh-krishna

Is there any workaround for this currently?

Use openjdk 21 as a work around.

tan-wei avatar Sep 15 '25 13:09 tan-wei

Or you can use ltex-plus as alternative.

tan-wei avatar Sep 16 '25 07:09 tan-wei