We Are Going To Discuss About Error:java: java.lang.ExceptionInInitializerError com.sun.tools.javac.code.TypeTags when trying to run maven. So lets Start this Java Article.
Error:java: java.lang.ExceptionInInitializerError com.sun.tools.javac.code.TypeTags when trying to run maven
- Error:java: java.lang.ExceptionInInitializerError com.sun.tools.javac.code.TypeTags when trying to run maven
The real issue is: one of library org.deeplearning4j:deeplearning4j-core:jar:0.9.1:compile this jar having a dependency on org.projectlombok:lombok:jar:1.16.16:compile.
- Error:java: java.lang.ExceptionInInitializerError com.sun.tools.javac.code.TypeTags when trying to run maven
The real issue is: one of library org.deeplearning4j:deeplearning4j-core:jar:0.9.1:compile this jar having a dependency on org.projectlombok:lombok:jar:1.16.16:compile.
Solution 1
This is wrong.
<maven.compiler.source>1.11</maven.compiler.source>
<maven.compiler.target>1.11</maven.compiler.target>
Post Java 1.9, the version naming has changed. Make the following changes in the pom.xml.
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
The same convention follows from 10+ Java version.
The real issue is: one of library org.deeplearning4j:deeplearning4j-core:jar:0.9.1:compile this jar having a dependency on org.projectlombok:lombok:jar:1.16.16:compile.
So this was an issue with Lombok which they fixed in a later version. To see all transitive dependencies you can do a mvn dependency:tree
and see all transitive dependencies of the libraries you have brought in.
I have included the below dependency in the pom and that resolved the issue.
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.2</version>
<scope>provided</scope>
</dependency>
Original Author Of This Content
Solution 2
I also got this error, when using jdk 10 to compile java8 source code.
After changing environment variable JAVA_HOME
to jdk8 home dir, this error disappear.
Original Author Of This Content
Solution 3
It could be a reason of getting this issues while running application Intellij that you haven’t configuration Project SDK setting in IDE.
Original Author Of This Content
Solution 4
Add this to pom.xml:
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
<scope>provided</scope>
</dependency>
Original Author Of This Content
Conclusion
So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.