Home » Java » Core Java » [Fixed] Java lang exceptionininitializererror com sun tools javac code typetags

About Venkatesh Nukala

Venkatesh Nukala
Venkatesh Nukala is a Software Engineer working for Online Payments Industry Leading company. In my free time, I would love to spend time with family and write articles on technical blogs. More on JavaProgramTo.com

[Fixed] Java lang exceptionininitializererror com sun tools javac code typetags

A quick guide to fix java lang exceptionininitializererror com sun tools javac code typetags with maven.

1. Overview

In this tutorial, We’ll learn how to fix the error “Java lang exceptionininitializererror com sun tools javac code typetags” when working with maven build.

How to create maven project?

2. Fix 1 – Java lang exceptionininitializererror com sun tools javac code typetags

Fixing this issue is by providing the correct java version.

In the pom.xml file, you might be giving the java version as below.

<maven.compiler.source>1.11</maven.compiler.source>
<maven.compiler.target>1.11</maven.compiler.target>

Below is the complete pom.xml file for reference.

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>Deep</artifactId>
    <version>1.0-SNAPSHOT</version>
    
    <properties>
        <maven.compiler.source>1.11</maven.compiler.source>
        <maven.compiler.target>1.11</maven.compiler.target>
        <dl4j.version>0.9.1</dl4j.version>
    </properties>

    <dependencies>

        <dependency>
            <groupId>org.nd4j</groupId>
            <artifactId>nd4j-native-platform</artifactId>
            <version>${dl4j.version}</version>
        </dependency>

        <dependency>
            <groupId>org.deeplearning4j</groupId>
            <artifactId>deeplearning4j-core</artifactId>
            <version>${dl4j.version}</version>
        </dependency>

        <dependency>
            <groupId>org.datavec</groupId>
            <artifactId>datavec-api</artifactId>
            <version>${dl4j.version}</version>
        </dependency>
        
        <dependency>
            <groupId>org.nd4j</groupId>
            <artifactId>nd4j-api</artifactId>
            <version>1.0.0-beta3</version>
        </dependency>
        
        <dependency>
            <groupId>org.deeplearning4j</groupId>
            <artifactId>deeplearning4j-play_2.11</artifactId>
            <version>0.9.1</version>
        </dependency>
        
    </dependencies>

</project>

This error may be appearing from jdk version after 1.9. and version has to be as 10 or 11 or 12 or 14 or 17.

And java versions should not start with “1.xx” after 1.9 versions. So, you provide the java version as 1.XX then you will see mostly “Java lang exceptionininitializererror” error.

To fix this error you need to change the java version as follows.

<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>

3. Fix 2 – Java lang exceptionininitializererror com sun tools javac code typetags

If the above fix does not work that means any one of the dependencies are needed to have the higher java versions.

You can find all transitive dependencies using “mvn dependency:tree” command 

For example, if you are using deeplearning4j-core.jar file then you may need to get the latest lombak jar file to fix the issue.

Add the below jar as a dependency in pom.xml file.

<dependency>
  <groupId>org.projectlombok</groupId>
  <artifactId>lombok</artifactId>
  <version>1.18.2</version>
  <scope>provided</scope>
</dependency>

4. Fix 3 – Java lang exceptionininitializererror com sun tools javac code typetags

If the above two solutions did not work then you need to change JAVA_HOME to the latest one or you need to change the jdk version in the eclipse.

5. Conclusion

In this article, we have seen the fixes to maven error – “Java lang exceptionininitializererror com sun tools javac code typetags” and its solutions.

How to fix java lang UnsupportedClassVersion?

Published on Java Code Geeks with permission by Venkatesh Nukala, partner at our JCG program. See the original article here: [Fixed] Java lang exceptionininitializererror com sun tools javac code typetags

Opinions expressed by Java Code Geeks contributors are their own.

(0 rating, 0 votes)
You need to be a registered member to rate this.
Start the discussion Views Tweet it!
Do you want to know how to develop your skillset to become a Java Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. JPA Mini Book
2. JVM Troubleshooting Guide
3. JUnit Tutorial for Unit Testing
4. Java Annotations Tutorial
5. Java Interview Questions
6. Spring Interview Questions
7. Android UI Design
and many more ....
I agree to the Terms and Privacy Policy
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments