Java classpath + split dependency error

Hi all,

Following the minimal example provided at Embedding LanguageTool in Java applications | dev.languagetool.org, I added the following Maven dependency to my pom.xml:
<dependency>
<groupId>org.languagetool</groupId>
<artifactId>language-en</artifactId>
<version>6.6</version>
</dependency>

and attempted to do the basic text checking with a JLanguageTool object.

This builds but throws an error: Class ‘org.languagetool.language.English’… not found in classpath.

Adding requires language.en to module-info resolves this error, but causes build to fail with: java: module org.apache.poi.poi reads package org.languagetool.chunking from both languagetool.core and language.en

I understand this could be a split dependency issue? Similar to this [Java 11] Dependencies & Requirements and this [jdk11] problem with dependencies · Issue #3303 · languagetool-org/languagetool · GitHub.

Haven’t found a way to resolve this so far. Would very much appreciate some help!!

Many thanks in advance.

Hi,

Which Java version are you using? As you linked some issues related to Java 11, I guess you are using Java 11 as well. Java 11 is not supported by LT 6.6. You need to use at least Java 17 or use LT 6.5.

Sorry, forgot to include this in the question - I’m using openjdk 21.0.10 2026-01-20 LTS (Corretto)

Is your code available on GitHub? If yes, I will try to build it myself.