Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 17 support #163

Open
r3n4ud opened this issue Mar 13, 2023 · 1 comment
Open

Java 17 support #163

r3n4ud opened this issue Mar 13, 2023 · 1 comment

Comments

@r3n4ud
Copy link

r3n4ud commented Mar 13, 2023

Hello,

The current master failed to build with OpenJDK 17.

A first issue is the JaCoCo version (0.8.5 seems incompatible with Java 17) -> Updating it to 0.8.7.
The next issue is a little bit trickier since it involves xstream:

[...]
[ERROR] gate.xml.TestXml.testAnnotationConsistencyForSaveAsXml  Time elapsed: 0.011 s  <<< ERROR!
com.thoughtworks.xstream.converters.ConversionException: 
No converter available
---- Debugging information ----
message             : No converter available
type                : java.util.Arrays$ArrayList
converter           : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
message[1]          : Unable to make field protected transient int java.util.AbstractList.modCount accessible: module java.base does not "opens java.util" to unnamed module @64a294a6
-------------------------------
[...]

For reference:

A workaround to get the tests go green is to add the following --add-opens to pom.xml:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>3.0.0-M8</version>
  <configuration>
    <argLine>
      --add-opens java.base/java.util=ALL-UNNAMED
    </argLine>
  </configuration>
</plugin>

I assume add --add-opens java.base/java.util=ALL-UNNAMED to the java -jar call will do at runtime.

Any plans to support Java 17?

@ianroberts
Copy link
Member

Currently the minimum JDK requirement for GATE is Java 8 and therefore the CI and release builds must be run on Java 8 and we can't add options like --add-opens to the pom as those are not understood by Java 8. So building gate-core on Java 17 is out of scope but I agree that allowing it to run correctly on Java 17 is worth doing if that isn't already the case.

Adding different JVM options depending what version of java we're running on is easy enough to do for Linux and Mac (where the launcher is a shell script) but much more difficult on Windows (where the launcher is an exe wrapper created using Launch4J). We'd either have to have the installer generate a different l4j.ini depending on the Java version (and document the required changes for people who are "installing" from the zip distro rather than running the installer) or switch to a different exe generator if we can find one that supports conditional argument sets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants