Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

2.9K
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!