Home > Java > javaTutorial > body text

How to solve the Java compilation error message prompting java.lang.ExceptionInInitializer

WBOY
Release: 2023-05-03 13:04:06
forward
1921 people have browsed it

Error message

The error message is:

Error:java: java.lang.ExceptionInInitializerError com.sun.tools.javac.code.TypeTags

How to solve the Java compilation error message prompting java.lang.ExceptionInInitializer

The error message is the same if using Maven.

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.449 s
[INFO] Finished at: 2020-02-26T08:34:45-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project core-java-annotations: Fatal error compiling: java.lang.ExceptionInInitializerError: com.sun.tools.javac.code.TypeTags -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Copy after login

What is the reason for this?

How to solve the Java compilation error message prompting java.lang.ExceptionInInitializer

The possible reason is that your compiler environment is used too high. But your dependency

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.6.12</version>
            <scope>provided</scope>
        </dependency>
Copy after login

is too low.

The solution is to lower your compiled JDK to 1.8.

Or upgrade org.projectlombok to the latest version.

For example, if we use IntelliJ 1.8 to compile the code, there will be no errors.

How to solve the Java compilation error message prompting java.lang.ExceptionInInitializer

The above is the detailed content of How to solve the Java compilation error message prompting java.lang.ExceptionInInitializer. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!