Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

1.6K
Vistas
java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector cannot access class com.sun.tools.javac.code.Symbol$

I'm trying to build the application with Java SE 11 and Gradle 7.0, and it builds using the IDE however when I try to build it using the terminal I get this error. How can I fix it.

java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x1d7a8227) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x1d7a8227
over 4 years ago · Santiago Trujillo
4 Respuestas
Responde la pregunta

0

I am having the same issue. When I was running in intellij terminal ./gradlew build war this exception happened.

I saw the problem is terminal java version. In terminal is 17 and my application is running in 11.

I solve my problem creating war file by intellij, but there is some missing environment configuration to fix in my terminal.

over 4 years ago · Santiago Trujillo Denunciar

0

I encountered the same error. To get around it, I ended up setting the JAVA_HOME environment variable before running gradle from the command line, and also added it to my path.

export JAVA_HOME=/Library/Java/JavaVirtualMachines/openjdk-11.jdk/Contents/Home 
export PATH=$JAVA_HOME/bin:$PATH

openjdk-11 worked fine for me, but you want to make sure your JAVA_HOME environment variable points to an actual location before setting it. This may vary based on your OS.

over 4 years ago · Santiago Trujillo Denunciar

0

Downgrading from open jdk 17 to 11 worked for me.

over 4 years ago · Santiago Trujillo Denunciar

0

Resolved it by recreating the project from existing sources & updating the .gradle-wrapper.properties version to 7.3.2

Location: gradle/wrapper/gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda