简体   繁体   中英

Debugging ExceptionInInitializerError

After a Java 10 migration, I am encountering an error java.lang.ExceptionInInitializerError

With no other info. Error occurs when I try to run/debug the project. Where should I begin looking to diagnose this?

Here is the full output in the console:

Information:java: Errors occurred while compiling module 'pw-support-server_main'
Information:javac 10.0.2 was used to compile java sources
Information:11/27/2018 6:06 PM - Compilation completed with 1 error and 0 warnings in 2 s 173 ms
Error:java: java.lang.ExceptionInInitializerError

Resolved using the following steps, which are probably very specific to my situation:

Changes to build.gradle:

buildscript {
    dependencies {
        classpath "io.franzbecker:gradle-lombok:1.10"
    }
}

Changed to classpath "io.franzbecker:gradle-lombok:1.14" (update to latest version)

Added inside of the block allprojects {

lombok {
    version = "1.18.4"
    sha256 = ""
}

The Franzbecker-lombok thing defaults to installing lombok 1.16.20, which has this issue. Telling gradle to use lombok's latest version solved this. Getting the right syntax among all the gradle version changes, Java version changes, etc, was just a little confusing.

Side note: The issue also occurred on Java 11.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM