2

I'm currently upgrading a project from JDK 11 to 17, and even tho I had previously dealt with the module java.base does not "opens java.util.concurrent" to unnamed module @6c38726a error and managed to fix it using the --add-opens java.base/java.util.concurrent=ALL-UNNAMED command on the VM options, for some reason it seems that for this project it isn't working.

Dockerfile:

ENV JAVA_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED"

pom.xml:

<properties>
<jvm.options>--add-opens=java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED</jvm.options>
</properties
<pluginManagement>
  <plugins>
    <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>${maven-compiler-plugin.version}</version>
      <configuration>
        <compilerArgs>${jvm.options}</compilerArgs>
        <optimize>true</optimize>
      </configuration>
   </plugin>
Onias da Rocha
  • 181
  • 3
  • 6

1 Answers1

0

Open the terminal and run the following commands:

javac -version

and you should see something about javac 17.x.x.

If you have a different version, maybe you should update your environment variables to point your JAVA_HOME to the appropriate JDK 17.

D0rm1nd0
  • 1,333
  • 1
  • 15
  • 19