Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

2.9K
Visualizações
Unable to compile JDK 17 using Maven 3.8: error: module jdk.compiler does not "opens com.sun.tools.javac.processing" to unnamed module

I am trying to compile an existing Spring Boot project using JDK 17 and Maven 3.8.4 and I keep getting this error.

Unable to make field private com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors com.sun.tools.javac.processing.JavacProcessingEnvironment.discoveredProcs accessible: module jdk.compiler does not "opens com.sun.tools.javac.processing" to unnamed module @521e3470

The problem also occurs with older versions of Maven like 3.6. It also happens with JDK 16. It does not matter what version of Java is configured in the pom.xml via the java.version, maven.compiler.source, and maven.compiler.target. only the JDK version being used to do the compiling... displayed in the mvn -v command.

The project compiles fine using JDK 15. The error happens immediately when compiling starts, right after the INFO message stating how many classes are being compiled. Happens in both my Windows laptop and Ubuntu CI server.

Any ideas what this could be?

EDIT: adding more of the POM file.

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.5.4</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>15</java.version>
    <maven.compiler.source>15</maven.compiler.source>
    <maven.compiler.target>15</maven.compiler.target>
    <spring-cloud.version>2020.0.4</spring-cloud.version>
    <ch.qos.logback.version>1.2.3</ch.qos.logback.version>
</properties>

EDIT: i also use Lombok

    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>1.18.4</version>
    </dependency>

EDIT: I dont think this is the same question as the other one because I searched by error msg, and that other question never popped up in the results. To arrive to that question, you need to know that the error is related to Lombok. The error gives no clue to Lombok being the culprit.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The problem is the usage of lombok project which in this case being used not the most recent version.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda