title: java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector cannot access class com.sun.tools.javac.code.Symbol$
body: <p>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.</p>
  <pre><code>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
  </code></pre>